uhttpd: Execute uci commit and reload_config once
[openwrt/openwrt.git] / package / network / services / uhttpd / files / ubus.default
1 #!/bin/sh
2
3 commit=0
4
5 if [ -z "$(uci -q get uhttpd.main.ubus_prefix)" ]; then
6 uci set uhttpd.main.ubus_prefix=/ubus
7 commit=1
8 fi
9
10 [ "$(uci -q get uhttpd.main.ubus_socket)" = "/var/run/ubus.sock" ] && {
11 uci set uhttpd.main.ubus_socket='/var/run/ubus/ubus.sock'
12 commit=1
13 }
14
15 [ "$commit" = 1 ] && uci commit uhttpd && /etc/init.d/uhttpd reload
16
17 exit 0