1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/squid3_ynh.git synced 2024-09-03 20:26:11 +02:00

Enhancement:Option to select random port

This commit is contained in:
anmol26s 2018-10-04 20:52:43 +05:30
parent 4bec853736
commit 2d783a0b8d
3 changed files with 15 additions and 2 deletions

View file

@ -5,6 +5,7 @@
;; Test complet
; Manifest
port="8095" (PORT)
; Checks
pkg_linter=1
setup_sub_dir=0

View file

@ -19,6 +19,16 @@
"multi_instance": false,
"services": [],
"arguments": {
"install" : []
"install" : [
"name": "squid_port",
"type": "port",
"ask": {
"en": "Choose a port for your Squid 3.",
"fr": "Entrez un port pour votre Squid 3."
},
"example": "8095",
"default": "8095"
}
]
}
}

View file

@ -24,6 +24,8 @@ ynh_abort_if_errors
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
squid_port=$YNH_APP_ARG_SQUID_PORT
app=$YNH_APP_INSTANCE_NAME
#=================================================
@ -38,7 +40,7 @@ app=$YNH_APP_INSTANCE_NAME
### - Remove the section "CLOSE A PORT" in the remove script
# Find a free port
port=$(ynh_find_port 3128)
port=$(ynh_find_port $sqid_port)
# Open this port
yunohost firewall allow --no-upnp TCP $port 2>&1
ynh_app_setting_set $app port $port