mirror of
https://github.com/YunoHost-Apps/adguardhome_ynh.git
synced 2024-09-03 18:06:23 +02:00
aee1f2aaca
Co-authored-by: yunohost-bot <yunohost@yunohost.org> Co-authored-by: OniriCorpe <OniriCorpe@users.noreply.github.com> Co-authored-by: tituspijean <titus+yunohost@pijean.ovh>
60 lines
2 KiB
Bash
60 lines
2 KiB
Bash
#!/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
|
|
|
|
#=================================================
|
|
# STANDARD REMOVE
|
|
#=================================================
|
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
|
#=================================================
|
|
|
|
# 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
|
|
|
|
# Remove the dedicated systemd config
|
|
ynh_remove_systemd_config
|
|
|
|
# Remove the dedicated NGINX config
|
|
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"
|
|
|
|
# Remove the dedicated dnsmasq config for AdGuardHome
|
|
ynh_secure_remove --file="/etc/dnsmasq.d/$app"
|
|
|
|
systemctl restart dnsmasq
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Removal of $app completed" --last
|