mirror of
https://github.com/YunoHost-Apps/squid3_ynh.git
synced 2024-09-03 20:26:11 +02:00
48 lines
1 KiB
Text
48 lines
1 KiB
Text
|
#!/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)
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
# Remove a service from the admin panel, added by `yunohost service add`
|
||
|
if yunohost service status | grep -q $app
|
||
|
then
|
||
|
echo "Remove $app service"
|
||
|
yunohost service remove $app
|
||
|
fi
|
||
|
|
||
|
#=================================================
|
||
|
# REMOVE DEPENDENCIES
|
||
|
#=================================================
|
||
|
|
||
|
# Remove metapackage and its dependencies
|
||
|
apt-get -y purge squid3
|
||
|
|
||
|
#=================================================
|
||
|
# CLOSE A PORT
|
||
|
#=================================================
|
||
|
|
||
|
if yunohost firewall list | grep -q "\- $port$"
|
||
|
then
|
||
|
echo "Close port $port" >&2
|
||
|
yunohost firewall disallow TCP $port 2>&1
|
||
|
fi
|
||
|
|
||
|
|
||
|
|