mirror of
https://github.com/YunoHost-Apps/samba_ynh.git
synced 2024-09-03 20:16:27 +02:00
59 lines
1.9 KiB
Bash
Executable file
59 lines
1.9 KiB
Bash
Executable file
#!/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)
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
|
|
#=================================================
|
|
# 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
|
|
yunohost service remove smbd
|
|
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"
|
|
ynh_secure_remove --file="$final_path"
|
|
fi
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removal of $app completed" --time --last
|