2019-01-09 09:31:49 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2024-05-21 18:34:12 +02:00
|
|
|
#=================================================
|
|
|
|
# PROCESS CLOSING PORTS
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Closing ports..." --weight=2
|
|
|
|
|
|
|
|
# close ports
|
|
|
|
ynh_print_info --message="Closing port 53..."
|
|
|
|
ynh_exec_warn_less yunohost firewall disallow Both 53
|
|
|
|
if [ "$dns_over_https" == "true" ]; then
|
|
|
|
ynh_print_info --message="Closing DoH and DoQ ports..."
|
|
|
|
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_tls" --no-reload
|
|
|
|
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
|
|
|
fi
|
|
|
|
|
2019-01-09 09:31:49 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
2021-07-06 17:45:33 +02:00
|
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
2019-04-05 11:47:08 +02:00
|
|
|
#=================================================
|
2019-01-09 09:31:49 +01:00
|
|
|
|
2021-07-06 17:45:33 +02:00
|
|
|
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
2024-05-21 18:34:12 +02:00
|
|
|
ynh_script_progression --message="Removing $app service integration..." --weight=1
|
|
|
|
yunohost service remove "$app"
|
|
|
|
|
|
|
|
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
2019-04-05 11:47:08 +02:00
|
|
|
|
|
|
|
# Remove the dedicated systemd config
|
|
|
|
ynh_remove_systemd_config
|
2019-01-09 09:31:49 +01:00
|
|
|
|
2021-07-06 17:45:33 +02:00
|
|
|
# Remove the dedicated NGINX config
|
2019-01-09 09:31:49 +01:00
|
|
|
ynh_remove_nginx_config
|
|
|
|
|
2024-05-21 18:34:12 +02:00
|
|
|
#=================================================
|
|
|
|
# REMOVE VARIOUS FILES specific to the app...
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# remove the kernel config file for DoQ
|
|
|
|
ynh_secure_remove --file="/etc/sysctl.d/10-adguardhome.conf"
|
2024-02-13 00:21:20 +01:00
|
|
|
|
|
|
|
# Remove the dedicated dnsmasq config for AdGuardHome
|
|
|
|
ynh_secure_remove --file="/etc/dnsmasq.d/$app"
|
|
|
|
|
|
|
|
systemctl restart dnsmasq
|
|
|
|
|
2019-01-09 10:31:03 +01:00
|
|
|
#=================================================
|
2019-04-05 11:47:08 +02:00
|
|
|
# END OF SCRIPT
|
2019-01-09 10:31:03 +01:00
|
|
|
#=================================================
|
|
|
|
|
2021-07-06 18:22:50 +02:00
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|