diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-10-11 22:56:58 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-10-11 22:56:58 +0000 |
commit | a5e34813e36ce3e11bad13d65dca92ef1c1eb913 (patch) | |
tree | 13297ab484571773e1b0e30dc4c23ed702326062 /libs/uci | |
parent | f735ef30bdf397b0b590f89cc5c77e7783232ca5 (diff) |
libs/uci: prevent concurrent luci-reload instances, write currently processed init script to status file
Diffstat (limited to 'libs/uci')
-rwxr-xr-x | libs/uci/root/sbin/luci-reload | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libs/uci/root/sbin/luci-reload b/libs/uci/root/sbin/luci-reload index b6b1ff6ce..24cf76064 100755 --- a/libs/uci/root/sbin/luci-reload +++ b/libs/uci/root/sbin/luci-reload @@ -5,7 +5,9 @@ apply_config() { config_get init "$1" init config_get exec "$1" exec config_get test "$1" test - + + echo "$2" > "/var/run/luci-reload-status" + [ -n "$init" ] && reload_init "$2" "$init" "$test" [ -n "$exec" ] && reload_exec "$2" "$exec" "$test" } @@ -26,9 +28,13 @@ reload_init() { } } +lock "/var/run/luci-reload" + config_load ucitrack -for i in $* -do +for i in $*; do config_foreach apply_config $i $i done + +rm -f "/var/run/luci-reload-status" +lock -u "/var/run/luci-reload" |