Improved reloading system, fixed a bug with saving network settings
authorSteven Barth <steven@midlink.org>
Sat, 19 Jul 2008 14:18:03 +0000 (14:18 +0000)
committerSteven Barth <steven@midlink.org>
Sat, 19 Jul 2008 14:18:03 +0000 (14:18 +0000)
contrib/package/luci-addons/Makefile
contrib/package/luci-addons/dist/sbin/luci-reload [new file with mode: 0644]
libs/web/root/etc/config/luci

index e1948905874c9bb7949473a19819aa2a3bc07e36..91943b8dae1d973153b80bf7665c4322daea7fdf 100644 (file)
@@ -31,6 +31,7 @@ define Package/luci-addons/install
 
        $(INSTALL_BIN) ./dist/usr/bin/run-parts $(1)/usr/bin
        $(INSTALL_BIN) ./dist/sbin/luci-flash $(1)/sbin
+       $(INSTALL_BIN) ./dist/sbin/luci-reload $(1)/sbin
        $(INSTALL_BIN) ./dist/etc/init.d/luci_fixtime $(1)/etc/init.d
        $(INSTALL_BIN) ./dist/etc/init.d/luci_ethers $(1)/etc/init.d
 
diff --git a/contrib/package/luci-addons/dist/sbin/luci-reload b/contrib/package/luci-addons/dist/sbin/luci-reload
new file mode 100644 (file)
index 0000000..48b6778
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+for i in $*
+do
+       [ -x /etc/init.d/$i ] && {
+               echo -n "Reloading $i... "
+               /etc/init.d/$i restart >/dev/null 2>&1 && echo "done." || echo "failed!" 
+       }
+done
\ No newline at end of file
index f12cdf0ba007fff5660cb6788546d617fea81403..76375eafea59ca01a83250a48b8196344f0a7dca 100644 (file)
@@ -19,20 +19,19 @@ config extern flash_keep
        option firewall "/etc/firewall.user"
 
 config event uci_oncommit
-       option network  "/etc/init.d/network restart; /etc/init.d/dnsmasq restart"
-       option wireless "/etc/init.d/network restart"
-       option olsr     "/etc/init.d/olsrd restart"
-       option dhcp     "/etc/init.d/dnsmasq restart"
-       option dropbear "/etc/init.d/dropbear restart"
-       option httpd    "/etc/init.d/httpd restart"
-       option fstab    "/etc/init.d/fstab restart"
-       option qos      "/etc/init.d/qos restart"
-       option luci_fw  "/etc/init.d/luci_fw restart"
-       option luci_ethers "/etc/init.d/luci_ethers restart; /etc/init.d/dnsmasq restart"
-       option luci_splash "/etc/init.d/luci_splash restart"
-       option freifunk "/etc/init.d/luci_freifunk restart"
-       option upnpd "/etc/init.d/miniupnpd enabled && /etc/init.d/miniupnpd restart || /etc/init.d/miniupnpd stop"
-       option ntpclient "/etc/init.d/ntpclient restart"
+       option network          "/sbin/luci-reload network firewall luci_fw dnsmasq"
+       option wireless         "/sbin/luci-reload network firewall luci_fw dnsmasq"
+       option olsr                     "/sbin/luci-reload olsrd"
+       option dhcp                     "/sbin/luci-reload dnsmasq"
+       option dropbear         "/sbin/luci-reload dropbear"
+       option httpd            "/sbin/luci-reload httpd"
+       option fstab            "/sbin/luci-reload fstab"
+       option qos                      "/sbin/luci-reload qos"
+       option luci_fw          "/sbin/luci-reload luci_fw"
+       option luci_ethers      "/sbin/luci-reload luci_ethers dnsmasq"
+       option luci_splash      "/sbin/luci-reload luci_splash"
+       option upnpd            "/etc/init.d/miniupnpd enabled && /sbin/luci-reload miniupnpd || /etc/init.d/miniupnpd stop"
+       option ntpclient        "/sbin/luci-reload ntpclient"
 
 config internal languages
        option de "Deutsch"