diff --git a/scripts/remove b/scripts/remove index 19721ec..0d25353 100644 --- a/scripts/remove +++ b/scripts/remove @@ -15,9 +15,13 @@ source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get $app domain) -port=$(ynh_app_setting_get $app port) -final_path=$(ynh_app_setting_get $app final_path) +#domain=$(ynh_app_setting_get $app domain) +domain=$(ynh_app_setting_get --app=$app --key=domain) + +#port=$(ynh_app_setting_get $app port) + +#final_path=$(ynh_app_setting_get $app final_path) +final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # STANDARD REMOVE @@ -37,7 +41,8 @@ ynh_package_remove emby-server #================================================= # Remove the app directory securely -ynh_secure_remove "$final_path" +#ynh_secure_remove "$final_path" +ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION @@ -50,11 +55,11 @@ ynh_remove_nginx_config # CLOSE A PORT #================================================= -if yunohost firewall list | grep -q "\- $port$" -then - echo "Close port $port" >&2 - yunohost firewall disallow TCP $port 2>&1 -fi +#if yunohost firewall list | grep -q "\- $port$" +#then +# ynh_script_progression --message="Closing port $port..." --time --weight=1 +# ynh_exec_warn_less yunohost firewall disallow TCP $port +#fi #================================================= # SPECIFIC REMOVE @@ -63,14 +68,16 @@ fi #================================================= # Remove a cron file -ynh_secure_remove "/etc/cron.d/$app" +#ynh_secure_remove "/etc/cron.d/$app" +ynh_secure_remove --file="/etc/cron.d/$app" # Remove a directory securely -ynh_secure_remove "/etc/apt/sources.list.d/onlyoffice.list" - +#ynh_secure_remove "/etc/apt/sources.list.d/onlyoffice.list" +ynh_secure_remove --file="/etc/$app/" # Remove the log files -ynh_secure_remove "/var/log/$app/" +#ynh_secure_remove "/var/log/$app/" +ynh_secure_remove --file="/var/log/$app/" #================================================= # GENERIC FINALIZATION @@ -79,4 +86,11 @@ ynh_secure_remove "/var/log/$app/" #================================================= # Delete a system user -ynh_system_user_delete $app +#ynh_system_user_delete $app +ynh_system_user_delete --username=$app + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Removal of $app completed" --time --last