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

61 lines
1.7 KiB
Text
Raw Normal View History

2017-04-08 00:06:50 +02:00
#!/bin/bash
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
#=================================================
# REMOVE SYSTEMD SERVICE
2018-05-04 11:47:06 +02:00
#=================================================
ynh_script_progression "Removing system configurations related to $app..."
2018-05-04 11:47:06 +02:00
if ynh_hide_warnings yunohost service status $app >/dev/null
then
ynh_script_progression "Removing $app service integration..."
yunohost service remove $app
fi
2017-04-08 00:06:50 +02:00
ynh_config_remove_systemd
2017-04-08 00:06:50 +02:00
ynh_config_remove_nginx
2018-05-04 11:47:06 +02:00
ynh_nodejs_remove
2022-05-28 01:29:55 +02:00
#=================================================
# REMOVE SANDBOX DOMAIN
#=================================================
# We don't test that in CI
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
ynh_script_progression "Removing sandbox domain : $sandboxdomain"
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
ynh_safe_rm "/etc/nginx/conf.d/$sandboxdomain.d/"
fi
fi
2018-05-04 11:47:06 +02:00
#=================================================
# END OF SCRIPT
2018-05-04 11:47:06 +02:00
#=================================================
ynh_script_progression "Removal of $app completed"