mirror of
https://github.com/YunoHost-Apps/squid3_ynh.git
synced 2024-09-03 20:26:11 +02:00
48 lines
1.1 KiB
Bash
Executable file
48 lines
1.1 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# LOAD SETTINGS
|
|
#=================================================
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
port=$(ynh_app_setting_get $app port)
|
|
squid=$(ynh_app_setting_get $app squid_folder)
|
|
|
|
|
|
|
|
# Remove a service from the admin panel, added by `yunohost service add`
|
|
if yunohost service status | grep -q $app
|
|
then
|
|
echo "Remove $squid service"
|
|
yunohost service remove $app
|
|
fi
|
|
|
|
#=================================================
|
|
# REMOVE DEPENDENCIES
|
|
#=================================================
|
|
|
|
# Remove metapackage and its dependencies
|
|
apt-get -y purge squid3
|
|
yunohost app ssowatconf
|
|
|
|
#=================================================
|
|
# CLOSE A PORT
|
|
#=================================================
|
|
|
|
if yunohost firewall list | grep -q "\- $port$"
|
|
then
|
|
echo "Close port $port" >&2
|
|
yunohost firewall disallow TCP $port 2>&1
|
|
fi
|
|
|
|
|
|
|