123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- #!/bin/bash
- source _common.sh
- source /usr/share/yunohost/helpers
- ynh_script_progression --message="Loading installation settings..."
- app=$YNH_APP_INSTANCE_NAME
- firmware_nonfree=$(ynh_app_setting_get --app=$app --key=firmware_nonfree)
- service_name=$(ynh_app_setting_get --app=$app --key=service_name)
- if yunohost service status $service_name >/dev/null 2>&1
- then
- ynh_script_progression --message="Removing $app service"
- yunohost service stop $service_name
- yunohost service remove $service_name
- fi
- ynh_script_progression --message="Stopping and removing the systemd service..."
- ynh_remove_systemd_config --service=$service_name
- ynh_script_progression --message="Removing dependencies..."
- ynh_remove_app_dependencies
- ynh_script_progression --message="Removing app main directory..."
- ynh_secure_remove --file="/usr/local/bin/$service_name"
- ynh_secure_remove --file="/usr/local/bin/iw_multissid"
- ynh_secure_remove --file="/usr/local/bin/iw_devices"
- ynh_secure_remove --file="/usr/local/bin/iw_ssids"
- ynh_secure_remove --file="/usr/local/bin/ipv6_expanded"
- ynh_secure_remove --file="/usr/local/bin/ipv6_compressed"
- ynh_secure_remove --file="/etc/sudoers.d/${app}_ynh"
- for FILE in $(ls /tmp/.ynh-hotspot-* 2>/dev/null)
- do
- ynh_secure_remove --file="$FILE"
- done
- ynh_secure_remove --file="/etc/dnsmasq.dhcpd/dhcpdv6.conf.tpl"
- ynh_secure_remove --file="/etc/dnsmasq.dhcpd/dhcpdv4.conf.tpl"
- for FILE in $(ls /etc/hostapd/hostapd.conf{.tpl?,} 2>/dev/null)
- do
- ynh_secure_remove --file="$FILE"
- done
- if yunohost firewall list | grep -q "\- 547$"
- then
- ynh_script_progression --message="Closing port 547"
- ynh_exec_warn_less yunohost firewall disallow TCP 547
- fi
- if yunohost firewall list | grep -q "\- 67$"
- then
- ynh_script_progression --message="Closing port 67"
- ynh_exec_warn_less yunohost firewall disallow TCP 67
- fi
- if [ -d /etc/nginx/conf.d/*.d/$app.conf ]; then
- ynh_secure_remove /etc/nginx/conf.d/*.d/$app.conf
- fi
- if [ -d /etc/php/*/fpm/pool.d/$app.conf ]; then
- ynh_secure_remove /etc/php/*/fpm/pool.d/$app.conf
- fi
- if [ -d /var/www/$app ]; then
- ynh_secure_remove /var/www/$app
- fi
- ynh_script_progression --message="Removing the dedicated system user..."
- ynh_system_user_delete --username=$app
- ynh_script_progression --message="Removal of $app completed"
|