From 95a97c8d32b9cbf98cedac56ba0c98716793ff8f Mon Sep 17 00:00:00 2001 From: Manuel Munz Date: Thu, 29 Sep 2011 09:43:33 +0000 Subject: [PATCH] contrib/meshwizard: Check if luci/luci-splash is installed before trying to setup it --- .../usr/bin/meshwizard/helpers/initial_config.sh | 16 +++++++++------- .../usr/bin/meshwizard/helpers/setup_splash.sh | 5 +++++ .../files/usr/bin/meshwizard/wizard.sh | 6 ++++++ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/initial_config.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/initial_config.sh index a5f670dd5..388886a54 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/initial_config.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/initial_config.sh @@ -45,13 +45,15 @@ if [ -n "$(uci -q get meshwizard.contact)" ]; then uci -q delete meshwizard.contact fi -if [ -n "$(uci -q get meshwizard.luci_main)" ]; then - echo " + Setup luci" - uci show meshwizard.luci_main |sed -e 's/^meshwizard/luci/g' -e 's/luci_main/main/' | while read line; do - eval uci set $line - echo " $line" - done - uci -q delete meshwizard.luci_main +if [ "$has_luci" == TRUE ]; then + if [ -n "$(uci -q get meshwizard.luci_main)" ]; then + echo " + Setup luci" + uci show meshwizard.luci_main |sed -e 's/^meshwizard/luci/g' -e 's/luci_main/main/' | while read line; do + eval uci set $line + echo " $line" + done + uci -q delete meshwizard.luci_main + fi fi uci commit diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh index 86f60aee1..f316798c2 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh @@ -6,6 +6,11 @@ net=$1 +if [ ! "$has_luci_splash" == TRUE ]; then + echo " Luci Splash is not installed, skipping setup of it." + exit +fi + handle_splash() { config_get network "$1" network if [ "$network" == "${netrenamed}dhcp" ]; then diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh index c03d11f93..f4e7af2bc 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh @@ -13,6 +13,12 @@ export dir="/usr/bin/meshwizard" . $dir/functions.sh 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 echo "+ Renaming wifi-devices in /etc/config/meshwizard" $dir/helpers/rename-wifi.sh -- 2.25.1