1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/phpboost_ynh.git synced 2024-09-03 19:56:33 +02:00

Update remove

This commit is contained in:
pp-r 2021-06-30 20:32:50 +02:00 committed by GitHub
parent cd86d3f2cd
commit a4821d5626
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,9 +15,13 @@ source /usr/share/yunohost/helpers
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) #domain=$(ynh_app_setting_get $app domain)
port=$(ynh_app_setting_get $app port) domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get $app final_path)
#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 # STANDARD REMOVE
@ -37,7 +41,8 @@ ynh_package_remove emby-server
#================================================= #=================================================
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove "$final_path" #ynh_secure_remove "$final_path"
ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
@ -50,11 +55,11 @@ ynh_remove_nginx_config
# CLOSE A PORT # CLOSE A PORT
#================================================= #=================================================
if yunohost firewall list | grep -q "\- $port$" #if yunohost firewall list | grep -q "\- $port$"
then #then
echo "Close port $port" >&2 # ynh_script_progression --message="Closing port $port..." --time --weight=1
yunohost firewall disallow TCP $port 2>&1 # ynh_exec_warn_less yunohost firewall disallow TCP $port
fi #fi
#================================================= #=================================================
# SPECIFIC REMOVE # SPECIFIC REMOVE
@ -63,14 +68,16 @@ fi
#================================================= #=================================================
# Remove a cron file # 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 # 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 # 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 # GENERIC FINALIZATION
@ -79,4 +86,11 @@ ynh_secure_remove "/var/log/$app/"
#================================================= #=================================================
# Delete a system user # 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