summaryrefslogtreecommitdiffstats
path: root/package/network/services/uhttpd/files/ubus.default
blob: 474016c1c55705597e2558560d589c0f40d81e56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

commit=0

if [ -z "$(uci -q get uhttpd.main.ubus_prefix)" ]; then
	uci set uhttpd.main.ubus_prefix=/ubus
	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'
	commit=1
}

[ "$commit" = 1 ] && uci commit uhttpd && /etc/init.d/uhttpd reload

exit 0