autossh: pass env variables on init properly

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>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@34493 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2012-12-04 16:21:05 +00:00
parent 5c4712418a
commit 8f6fab3fdd

View File

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