1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/timemachine_ynh.git synced 2024-09-03 20:26:33 +02:00
timemachine_ynh/scripts/remove
Éric Gaspar 386754b54c v2
2023-09-10 18:18:30 +02:00

57 lines
1.9 KiB
Bash
Executable file

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#=================================================
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status smbd >/dev/null
then
ynh_script_progression --message="Removing smbd service integration..."
yunohost service remove smbd
fi
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status avahi-daemon >/dev/null
then
ynh_script_progression --message="Removing avahi-daemon service integration..."
yunohost service remove avahi-daemon
fi
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=1
# Delete User from Samba
ynh_exec_warn_less smbpasswd -x $app
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..." --weight=1
# Remove the log files
ynh_secure_remove --file="/etc/smb/smb.d/$app.conf"
ynh_secure_remove --file="/etc/avahi/services/$app.service"
samba_sysadmin_update
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last