luci: fix UI not display after upgrade issue.
This commit is contained in:
@@ -655,6 +655,33 @@ download_file() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_and_add_entry() {
|
||||||
|
local docommit=0
|
||||||
|
uci -q get smartdns.@smartdns[0] >/dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
uci -q add smartdns smartdns >/dev/null
|
||||||
|
docommit=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
uci -q get smartdns.@domain-rule[0] >/dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
uci -q add smartdns domain-rule >/dev/null
|
||||||
|
docommit=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$docommit" = "1" ]; then
|
||||||
|
uci -q commit smartdns >/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "$SMARTDNS_DOMAIN_LIST_DOWNLOAD_DIR" ]; then
|
||||||
|
mkdir -p "$SMARTDNS_DOMAIN_LIST_DOWNLOAD_DIR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "$SMARTDNS_CONF_DOWNLOAD_DIR" ]; then
|
||||||
|
mkdir -p "$SMARTDNS_CONF_DOWNLOAD_DIR"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
updatefiles() {
|
updatefiles() {
|
||||||
config_load "smartdns"
|
config_load "smartdns"
|
||||||
config_foreach download_file "download-file"
|
config_foreach download_file "download-file"
|
||||||
@@ -669,6 +696,7 @@ service_stopped()
|
|||||||
|
|
||||||
start_service()
|
start_service()
|
||||||
{
|
{
|
||||||
|
check_and_add_entry
|
||||||
config_load "smartdns"
|
config_load "smartdns"
|
||||||
config_foreach load_service "smartdns"
|
config_foreach load_service "smartdns"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user