From 2d783a0b8da7bef152778b84faece30e0e796034 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Thu, 4 Oct 2018 20:52:43 +0530 Subject: [PATCH] Enhancement:Option to select random port --- check_process | 1 + manifest.json | 12 +++++++++++- scripts/install | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index 71b65a9..6baa614 100644 --- a/check_process +++ b/check_process @@ -5,6 +5,7 @@ ;; Test complet ; Manifest + port="8095" (PORT) ; Checks pkg_linter=1 setup_sub_dir=0 diff --git a/manifest.json b/manifest.json index 5842fa6..0b22b68 100644 --- a/manifest.json +++ b/manifest.json @@ -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" + } + ] } } diff --git a/scripts/install b/scripts/install index 5ec92d3..19ff3d8 100755 --- a/scripts/install +++ b/scripts/install @@ -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