aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/uhttpd
diff options
context:
space:
mode:
Diffstat (limited to 'package/network/services/uhttpd')
-rw-r--r--package/network/services/uhttpd/files/ubus.default10
1 files changed, 6 insertions, 4 deletions
diff --git a/package/network/services/uhttpd/files/ubus.default b/package/network/services/uhttpd/files/ubus.default
index b218d3f85d..474016c1c5 100644
--- a/package/network/services/uhttpd/files/ubus.default
+++ b/package/network/services/uhttpd/files/ubus.default
@@ -1,15 +1,17 @@
#!/bin/sh
+commit=0
+
if [ -z "$(uci -q get uhttpd.main.ubus_prefix)" ]; then
uci set uhttpd.main.ubus_prefix=/ubus
- uci commit uhttpd
- /etc/init.d/uhttpd reload
+ commit=1
fi
[ "$(uci -q get uhttpd.main.ubus_socket)" = "/var/run/ubus.sock" ] && {
uci set uhttpd.main.ubus_socket='/var/run/ubus/ubus.sock'
- uci commit uhttpd
- /etc/init.d/uhttpd reload
+ commit=1
}
+[ "$commit" = 1 ] && uci commit uhttpd && /etc/init.d/uhttpd reload
+
exit 0