1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cockpit_ynh.git synced 2024-09-03 18:16:26 +02:00
cockpit_ynh/scripts/remove

56 lines
1.9 KiB
Text
Raw Normal View History

2019-02-20 12:08:50 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD REMOVE
#=================================================
2020-11-16 19:38:35 +01:00
# REMOVE SERVICE INTEGRATION IN YUNOHOST
2019-04-10 11:19:13 +02:00
#=================================================
2022-03-13 21:51:45 +01:00
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
2020-11-16 19:38:35 +01:00
if ynh_exec_warn_less yunohost service status $app >/dev/null
2019-04-10 11:19:13 +02:00
then
2022-05-31 01:08:23 +02:00
ynh_script_progression --message="Removing $app service integration..." --weight=1
2022-03-13 21:51:45 +01:00
yunohost service remove $app
2019-04-10 11:19:13 +02:00
fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
2020-11-16 19:38:35 +01:00
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
2019-02-20 12:08:50 +01:00
2019-04-10 11:19:13 +02:00
# Remove the dedicated systemd config
2022-03-13 21:51:45 +01:00
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=5
# Remove the dedicated NGINX config
ynh_remove_nginx_config
2019-02-20 12:08:50 +01:00
#=================================================
2022-03-13 21:51:45 +01:00
# SPECIFIC REMOVE
2019-02-20 12:08:50 +01:00
#=================================================
2022-03-13 21:51:45 +01:00
# REMOVE VARIOUS FILES
#=================================================
2022-09-03 00:44:25 +02:00
ynh_script_progression --message="Removing various files..." --weight=1
2019-02-20 12:08:50 +01:00
2022-03-13 21:51:45 +01:00
# Remove a directory securely
ynh_secure_remove --file="/etc/$app"
2019-02-20 12:08:50 +01:00
2019-04-10 11:19:13 +02:00
#=================================================
# END OF SCRIPT
#=================================================
2021-07-07 19:08:59 +02:00
ynh_script_progression --message="Removal of $app completed" --last