mirror of
https://github.com/YunoHost-Apps/yunorunner_ynh.git
synced 2024-09-03 20:36:13 +02:00
Close not needed port
This commit is contained in:
parent
479a6c02d4
commit
38e1fc106d
2 changed files with 11 additions and 1 deletions
|
@ -61,7 +61,7 @@ ynh_print_info "Configuring firewall..."
|
|||
# Find a free port
|
||||
port=$(ynh_find_port 4242)
|
||||
# Open this port
|
||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
|
||||
#ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
|
||||
ynh_app_setting_set $app port $port
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -38,6 +38,16 @@ if [ -z "$port" ]; then
|
|||
ynh_app_setting_set $app port $port
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# CLOSE A PORT
|
||||
#=================================================
|
||||
|
||||
if yunohost firewall list | grep -q "\- $port$"
|
||||
then
|
||||
ynh_print_info "Closing port $port"
|
||||
ynh_exec_warn_less yunohost firewall disallow TCP $port
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue