2020-12-12 19:37:20 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# REMOVE SERVICE FROM ADMIN PANEL
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Remove a service from the admin panel, added by `yunohost service add`
|
2023-11-09 20:37:13 +01:00
|
|
|
if yunohost service status $app >/dev/null 2>&1
|
2020-12-12 19:37:20 +01:00
|
|
|
then
|
|
|
|
ynh_script_progression --message="Removing $app service integration..."
|
2023-11-09 20:37:13 +01:00
|
|
|
yunohost service remove $app
|
2020-12-12 19:37:20 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STOP PYINVENTORY'S SERVICES
|
|
|
|
#=================================================
|
2022-09-18 17:49:33 +02:00
|
|
|
ynh_script_progression --message="Stopping and removing systemd service '$app'..." --weight=5
|
2020-12-12 19:37:20 +01:00
|
|
|
|
2023-11-09 20:37:13 +01:00
|
|
|
ynh_remove_systemd_config --service=$app
|
2020-12-12 19:37:20 +01:00
|
|
|
|
|
|
|
##=================================================
|
|
|
|
## REMOVE REDIS DB
|
|
|
|
##=================================================
|
|
|
|
|
|
|
|
ynh_redis_remove_db
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removing app main directory..."
|
|
|
|
|
2023-11-09 20:37:13 +01:00
|
|
|
# /var/www/$app/
|
|
|
|
ynh_secure_remove --file="$install_dir"
|
|
|
|
|
|
|
|
# /home/yunohost.app/$app/
|
|
|
|
ynh_secure_remove --file="$data_dir"
|
2020-12-12 19:37:20 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removing nginx web server configuration..."
|
|
|
|
|
|
|
|
# Remove the dedicated nginx config
|
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE LOGROTATE CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removing logrotate configuration..."
|
|
|
|
|
|
|
|
# Remove the app-specific logrotate config
|
|
|
|
ynh_remove_logrotate
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|