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