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:
parent
4bec853736
commit
2d783a0b8d
3 changed files with 15 additions and 2 deletions
|
@ -5,6 +5,7 @@
|
|||
|
||||
;; Test complet
|
||||
; Manifest
|
||||
port="8095" (PORT)
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=0
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue