1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/samba_ynh.git synced 2024-09-03 20:16:27 +02:00
samba_ynh/scripts/remove

60 lines
1.9 KiB
Text
Raw Normal View History

2022-02-22 13:59:54 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
2022-05-07 18:24:57 +02:00
ynh_script_progression --message="Loading installation settings..." --weight=1
2022-02-22 13:59:54 +01:00
app=$YNH_APP_INSTANCE_NAME
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
2022-02-27 20:07:04 +01:00
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
2022-02-22 13:59:54 +01:00
#=================================================
# 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 $app >/dev/null
then
2022-05-07 18:24:57 +02:00
ynh_script_progression --message="Removing $app service integration..." --weight=1
2022-02-27 20:07:04 +01:00
yunohost service remove smbd
2022-02-22 13:59:54 +01:00
fi
#=================================================
# REMOVE DEPENDENCIES
#=================================================
2022-05-07 18:24:57 +02:00
ynh_script_progression --message="Removing dependencies..." --weight=2
2022-02-22 13:59:54 +01:00
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# REMOVE DATA DIR
#=================================================
# Remove the data directory if --purge option is used
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
then
2022-05-07 18:24:57 +02:00
ynh_script_progression --message="Removing app data directory..." --weight=10
2022-02-22 13:59:54 +01:00
ynh_secure_remove --file="$datadir"
2022-02-27 20:07:04 +01:00
ynh_secure_remove --file="$final_path"
2022-02-22 13:59:54 +01:00
fi
#=================================================
# END OF SCRIPT
#=================================================
2022-05-07 18:24:57 +02:00
ynh_script_progression --message="Removal of $app completed" --last