contrib/meshwizard: Check if luci/luci-splash is installed before trying to setup it
This commit is contained in:
parent
2d0171d72c
commit
95a97c8d32
3 changed files with 20 additions and 7 deletions
|
@ -45,13 +45,15 @@ if [ -n "$(uci -q get meshwizard.contact)" ]; then
|
||||||
uci -q delete meshwizard.contact
|
uci -q delete meshwizard.contact
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$(uci -q get meshwizard.luci_main)" ]; then
|
if [ "$has_luci" == TRUE ]; then
|
||||||
echo " + Setup luci"
|
if [ -n "$(uci -q get meshwizard.luci_main)" ]; then
|
||||||
uci show meshwizard.luci_main |sed -e 's/^meshwizard/luci/g' -e 's/luci_main/main/' | while read line; do
|
echo " + Setup luci"
|
||||||
eval uci set $line
|
uci show meshwizard.luci_main |sed -e 's/^meshwizard/luci/g' -e 's/luci_main/main/' | while read line; do
|
||||||
echo " $line"
|
eval uci set $line
|
||||||
done
|
echo " $line"
|
||||||
uci -q delete meshwizard.luci_main
|
done
|
||||||
|
uci -q delete meshwizard.luci_main
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
uci commit
|
uci commit
|
||||||
|
|
|
@ -6,6 +6,11 @@
|
||||||
|
|
||||||
net=$1
|
net=$1
|
||||||
|
|
||||||
|
if [ ! "$has_luci_splash" == TRUE ]; then
|
||||||
|
echo " Luci Splash is not installed, skipping setup of it."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
handle_splash() {
|
handle_splash() {
|
||||||
config_get network "$1" network
|
config_get network "$1" network
|
||||||
if [ "$network" == "${netrenamed}dhcp" ]; then
|
if [ "$network" == "${netrenamed}dhcp" ]; then
|
||||||
|
|
|
@ -13,6 +13,12 @@ export dir="/usr/bin/meshwizard"
|
||||||
. $dir/functions.sh
|
. $dir/functions.sh
|
||||||
debug=1
|
debug=1
|
||||||
|
|
||||||
|
# Check which packages we have installed
|
||||||
|
export has_luci=FALSE
|
||||||
|
opkg list_installed |grep luci-mod-admin > /dev/null && export has_luci=TRUE
|
||||||
|
export has_luci_splash=FALSE
|
||||||
|
opkg list_installed |grep luci-app-splash > /dev/null && export has_luci_splash=TRUE
|
||||||
|
|
||||||
# Rename wifi interfaces
|
# Rename wifi interfaces
|
||||||
echo "+ Renaming wifi-devices in /etc/config/meshwizard"
|
echo "+ Renaming wifi-devices in /etc/config/meshwizard"
|
||||||
$dir/helpers/rename-wifi.sh
|
$dir/helpers/rename-wifi.sh
|
||||||
|
|
Loading…
Reference in a new issue