2017-04-08 00:06:50 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-07-23 17:46:25 +02:00
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
2023-03-12 08:42:18 +01:00
|
|
|
# REMOVE SYSTEM CONFIGURATIONS
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
2024-08-30 22:46:17 +02:00
|
|
|
# REMOVE SYSTEMD SERVICE
|
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_script_progression "Removing system configurations related to $app..."
|
2018-05-04 11:47:06 +02:00
|
|
|
|
2020-12-04 11:33:12 +01:00
|
|
|
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
2024-08-30 22:46:17 +02:00
|
|
|
if ynh_hide_warnings yunohost service status $app >/dev/null
|
2020-07-18 11:46:45 +02:00
|
|
|
then
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_script_progression "Removing $app service integration..."
|
2020-07-18 11:46:45 +02:00
|
|
|
yunohost service remove $app
|
|
|
|
fi
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2020-07-18 11:46:45 +02:00
|
|
|
# Remove the dedicated systemd config
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_config_remove_systemd
|
2017-04-08 00:06:50 +02:00
|
|
|
|
2020-10-13 13:52:56 +02:00
|
|
|
# Remove the dedicated NGINX config
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_config_remove_nginx
|
2018-05-04 11:47:06 +02:00
|
|
|
|
2022-05-28 01:29:55 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_script_progression "Removing dependencies..."
|
2022-05-28 01:29:55 +02:00
|
|
|
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_nodejs_remove
|
2022-05-28 01:29:55 +02:00
|
|
|
|
2022-12-09 18:01:27 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE SANDBOX DOMAIN
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# We don't test that in CI
|
2024-08-30 22:46:17 +02:00
|
|
|
if ! ynh_in_ci_tests; then
|
|
|
|
|
2023-02-09 15:43:33 +01:00
|
|
|
# if the main domain for the app is a root domain, we create a correct sandbox subdomain
|
|
|
|
if [[ $domain == *"."* ]]; then
|
|
|
|
sandboxdomain=sandbox.$domain
|
|
|
|
fi
|
|
|
|
# if the main domain for the app is already a sub-domain, we create a correct sandbox domain
|
|
|
|
if [[ $domain == *"."*"."* ]]; then
|
|
|
|
sandboxdomain=sandbox-$domain
|
|
|
|
fi
|
|
|
|
# if the main domain for the app is a .local root domain, we create a correct sandbox subdomain
|
|
|
|
if [[ $domain == *".local" ]]; then
|
|
|
|
sandboxdomain=sandbox-$domain
|
|
|
|
fi
|
2024-08-30 22:46:17 +02:00
|
|
|
|
|
|
|
ynh_script_progression "Removing sandbox domain : $sandboxdomain"
|
|
|
|
|
2022-12-09 18:01:27 +01:00
|
|
|
if yunohost domain list | grep -q $sandboxdomain
|
|
|
|
then #if domain exist we remove it
|
|
|
|
yunohost domain remove $sandboxdomain
|
|
|
|
# we clean the nginx configuration we added
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_safe_rm "/etc/nginx/conf.d/$sandboxdomain.d/"
|
2022-12-09 18:01:27 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
2020-07-18 11:46:45 +02:00
|
|
|
# END OF SCRIPT
|
2018-05-04 11:47:06 +02:00
|
|
|
#=================================================
|
|
|
|
|
2024-08-30 22:46:17 +02:00
|
|
|
ynh_script_progression "Removal of $app completed"
|