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

61 lines
2 KiB
Text
Raw Normal View History

2019-01-09 09:31:49 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# 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`)
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
#=================================================
# 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