2022-06-15 09:54:44 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2022-07-13 04:01:56 +02:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
|
|
|
#=================================================
|
2023-12-21 19:11:13 +01:00
|
|
|
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
2022-07-13 04:01:56 +02:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2022-06-15 15:30:00 +02:00
|
|
|
# Delete User from Samba
|
|
|
|
ynh_exec_warn_less smbpasswd -x $app
|
|
|
|
|
2022-06-15 09:54:44 +02:00
|
|
|
# Remove the log files
|
2022-06-15 15:30:00 +02:00
|
|
|
ynh_secure_remove --file="/etc/smb/smb.d/$app.conf"
|
|
|
|
ynh_secure_remove --file="/etc/avahi/services/$app.service"
|
2022-06-15 09:54:44 +02:00
|
|
|
|
2022-06-15 15:46:21 +02:00
|
|
|
samba_sysadmin_update
|
|
|
|
|
2022-06-15 09:54:44 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2022-07-13 04:01:56 +02:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|