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
#=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1
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
ynh_script_progression --message="Removing $app service integration..." --time --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
#=================================================
ynh_script_progression --message="Removing dependencies..." --time --weight=1
# 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
ynh_script_progression --message="Removing app data directory..." --time --weight=1
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
#=================================================
ynh_script_progression --message="Removal of $app completed" --time --last