mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 15:02:32 +00:00
501221af54
Instead of doing uci commit and reload_config for each setting do it only once when one of these options was changed. This should make it a little faster when both conditions are taken. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
18 lines
350 B
Bash
18 lines
350 B
Bash
#!/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
|