summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2011-06-01 11:56:38 +0000
committerManuel Munz <freifunk@somakoma.de>2011-06-01 11:56:38 +0000
commit1d70d03c08a061eff901a65d952526246989181b (patch)
treed40d2e217170ae8d6d0a20c502625434b656755e /libs
parentcbdf1e095cf2263eba7e208d68217833cd77135f (diff)
libs/core: Allow the use of commands with arguments or of multiple commands for exec in /etc/config/ucitrack
Diffstat (limited to 'libs')
-rwxr-xr-xlibs/core/root/sbin/luci-reload13
1 files changed, 9 insertions, 4 deletions
diff --git a/libs/core/root/sbin/luci-reload b/libs/core/root/sbin/luci-reload
index 24cf76064b..4bcac045b3 100755
--- a/libs/core/root/sbin/luci-reload
+++ b/libs/core/root/sbin/luci-reload
@@ -13,10 +13,15 @@ apply_config() {
}
reload_exec() {
- [ -x $2 ] && {
- echo "Reloading $1... "
- $2 >/dev/null 2>&1
- [ -n "$3" -a "$?" != "$3" ] && echo '!!! Failed to reload' $1 '!!!'
+ local service="$1"
+ local ok="$3"
+ set -- $2
+ local cmd="$1"; shift
+
+ [ -x "$cmd" ] && {
+ echo "Reloading $service... "
+ ( $cmd "$@" ) 2>/dev/null 1>&2
+ [ -n "$ok" -a "$?" != "$ok" ] && echo '!!! Failed to reload' $service '!!!'
}
}