#!/bin/bash #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= source _common.sh source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME port=$(ynh_app_setting_get $app port) squid=$(ynh_app_setting_get $app squid_folder) #================================================= # STANDARD REMOVE #================================================= # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= # Remove the service from the list of services known by Yunohost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then ynh_script_progression --message="Remove $squid service" yunohost service remove $app fi #================================================= # REMOVE DEPENDENCIES #================================================= # Remove metapackage and its dependencies apt-get -y purge squid3 yunohost app ssowatconf ynh_remove_app_dependencies #================================================= # CLOSE A PORT #================================================= if yunohost firewall list | grep -q "\- $port$" then ynh_script_progression --message="Closing port $port..." ynh_exec_warn_less yunohost firewall disallow TCP $port fi #================================================= # SPECIFIC REMOVE #================================================= # REMOVE VARIOUS FILES #================================================= # Remove a directory securely ynh_secure_remove --file="/etc/$squid/" # Remove the log files ynh_secure_remove --file="/var/log/$squid/access.log" #================================================= # END OF SCRIPT #================================================= ynh_script_progression --message="Removal of $app completed"