aboutsummaryrefslogtreecommitdiff
path: root/net/autossh/files
diff options
context:
space:
mode:
authorAdrià Llaudet <adria.llaudet@gmail.com>2018-04-11 20:22:17 +0200
committerAdrià Llaudet <adria.llaudet@gmail.com>2018-04-11 20:22:17 +0200
commitaf31a192f80cf948004334507073751294a436a2 (patch)
treed47ec0e2df17c0009824a16b74e1ffc8bf1c7557 /net/autossh/files
parent7103c62b61b8a7fb0542b04e4666cbae06379ff0 (diff)
autossh: add an 'enabled' option within the uci configuration file
In a tool like this one, you really want an option to establish if the service should start or not by default on boot time, especially when its configuration file has to be customized by the user. In the configuration file, the new 'enabled' option is setted to '0' by default since the configuration provided by default will not be the one finally used. In the init script, the new 'enabled' option is setted to '1' by default in order to support the previous configuration file behaviour. Signed-off-by: Adrià Llaudet <adria.llaudet@gmail.com>
Diffstat (limited to 'net/autossh/files')
-rw-r--r--net/autossh/files/autossh.config1
-rw-r--r--net/autossh/files/autossh.hotplug2
-rw-r--r--net/autossh/files/autossh.init3
3 files changed, 5 insertions, 1 deletions
diff --git a/net/autossh/files/autossh.config b/net/autossh/files/autossh.config
index 6ec323858..faee881a9 100644
--- a/net/autossh/files/autossh.config
+++ b/net/autossh/files/autossh.config
@@ -3,3 +3,4 @@ config autossh
option gatetime '0'
option monitorport '20000'
option poll '600'
+ option enabled '0'
diff --git a/net/autossh/files/autossh.hotplug b/net/autossh/files/autossh.hotplug
index 4f695f44c..0e73cae4c 100644
--- a/net/autossh/files/autossh.hotplug
+++ b/net/autossh/files/autossh.hotplug
@@ -10,5 +10,5 @@
[ "$ACTION" = "ifdown" ] && {
/etc/init.d/autossh stop
}
-
+
}
diff --git a/net/autossh/files/autossh.init b/net/autossh/files/autossh.init
index f81bf4d87..e21b3910b 100644
--- a/net/autossh/files/autossh.init
+++ b/net/autossh/files/autossh.init
@@ -10,6 +10,9 @@ start_instance() {
config_get gatetime "$section" 'gatetime'
config_get monitorport "$section" 'monitorport'
config_get poll "$section" 'poll'
+ config_get_bool enabled "$section" 'enabled' '1'
+
+ [ "$enabled" = 1 ] || exit 0
export AUTOSSH_GATETIME="${gatetime:-30}"
export AUTOSSH_POLL="${poll:-600}"