From dbde0216c29148520226a96a57be20ceb2406f45 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sat, 6 Sep 2008 13:51:51 +0000 Subject: Rewrote UCI apply logic --- libs/uci/root/sbin/luci-reload | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 libs/uci/root/sbin/luci-reload (limited to 'libs/uci/root/sbin') diff --git a/libs/uci/root/sbin/luci-reload b/libs/uci/root/sbin/luci-reload new file mode 100644 index 0000000000..a92c6eb7fa --- /dev/null +++ b/libs/uci/root/sbin/luci-reload @@ -0,0 +1,31 @@ +#!/bin/sh +. /etc/functions.sh + +apply_config() { + config_get init "$1" init + config_get exec "$1" exec + + [ -n "$init" ] && reload_init "$2" "$init" + [ -n "$exec" ] && reload_exec "$2" "$exec" +} + +reload_exec() { + [ -x $2 ] && { + echo -n "Reloading $1... " + $2 >/dev/null 2>&1 && echo "done." || echo "failed!" + } +} + +reload_init() { + [ -x /etc/init.d/$2 ] && /etc/init.d/$2 enabled && { + echo -n "Reloading $1... " + /etc/init.d/$2 reload >/dev/null 2>&1 && echo "done." || echo "failed!" + } +} + +config_load ucitrack + +for i in $* +do + config_foreach apply_config $i +done \ No newline at end of file -- cgit v1.2.3