autossh: pass env variables on init properly
authorFlorian Fainelli <florian@openwrt.org>
Tue, 4 Dec 2012 16:21:05 +0000 (16:21 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Tue, 4 Dec 2012 16:21:05 +0000 (16:21 +0000)
Busybox's ash doesn't pass unexported environment variables to processes
started from within a function, so a service started with

MMM=xyz service_start blablabla

will never see the MMM variable.

Fix this by exporting the important variables.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
SVN-Revision: 34493

net/autossh/files/autossh.init

index cdff07c35f1fde96de567da1dde410abbdf5c0f5..f81bf4d87a52474371183f96ffaace64208313ba 100644 (file)
@@ -11,8 +11,8 @@ start_instance() {
        config_get monitorport "$section" 'monitorport'
        config_get poll "$section" 'poll'
 
-       AUTOSSH_GATETIME="${gatetime:-30}" \
-       AUTOSSH_POLL="${poll:-600}" \
+       export AUTOSSH_GATETIME="${gatetime:-30}"
+       export AUTOSSH_POLL="${poll:-600}"
        service_start /usr/sbin/autossh -M ${monitorport:-20000} -f ${ssh}
 }