From c1139246d7faed34dd183b77278ea2aaf1660621 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Sun, 5 Nov 2023 13:26:19 +0100 Subject: [PATCH 1/2] add autohotspot config checks --- scripts/installscripts/buster-install-default.sh | 9 +++++++++ scripts/installscripts/tests/test_installation.sh | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/scripts/installscripts/buster-install-default.sh b/scripts/installscripts/buster-install-default.sh index d4b35899e..59cf777ee 100644 --- a/scripts/installscripts/buster-install-default.sh +++ b/scripts/installscripts/buster-install-default.sh @@ -759,6 +759,7 @@ check_config_file() { check_variable "WIFIipRouter" fi fi + check_variable "EXISTINGuse" check_variable "AUDIOiFace" @@ -776,6 +777,14 @@ check_config_file() { check_variable "DIRaudioFolders" check_variable "GPIOconfig" + # Feature optional. if config not present, defaults to NO + if [[ "$AUTOHOTSPOTconfig" == "YES" ]]; then + check_variable "AUTOHOTSPOTssid" + check_variable "AUTOHOTSPOTcountryCode" + check_variable "AUTOHOTSPOTpass" + check_variable "AUTOHOTSPOTip" + fi + if [ "${fail}" == "true" ]; then exit 1 fi diff --git a/scripts/installscripts/tests/test_installation.sh b/scripts/installscripts/tests/test_installation.sh index da23da9cc..ba899f855 100755 --- a/scripts/installscripts/tests/test_installation.sh +++ b/scripts/installscripts/tests/test_installation.sh @@ -136,6 +136,18 @@ verify_conf_file() { fi check_variable "MPDconfig" check_variable "DIRaudioFolders" + check_variable "GPIOconfig" + + # Feature optional. if config not present, defaults to NO + if [[ -n "${AUTOHOTSPOTconfig}" ]]; then + echo "\$AUTOHOTSPOTconfig is set to '$AUTOHOTSPOTconfig'" + if [[ "$AUTOHOTSPOTconfig" == "YES" ]]; then + check_variable "AUTOHOTSPOTssid" + check_variable "AUTOHOTSPOTcountryCode" + check_variable "AUTOHOTSPOTpass" + check_variable "AUTOHOTSPOTip" + fi + fi if [ "${fail}" == "true" ]; then exit 1 From 6537981f589e7eabb1dc27fb90fba5b5e6cc487d Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Sun, 5 Nov 2023 14:20:10 +0100 Subject: [PATCH 2/2] print info if AUTOHOTSPOTconfig is not set --- scripts/installscripts/buster-install-default.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/installscripts/buster-install-default.sh b/scripts/installscripts/buster-install-default.sh index 59cf777ee..bd5da1bf9 100644 --- a/scripts/installscripts/buster-install-default.sh +++ b/scripts/installscripts/buster-install-default.sh @@ -778,11 +778,15 @@ check_config_file() { check_variable "GPIOconfig" # Feature optional. if config not present, defaults to NO - if [[ "$AUTOHOTSPOTconfig" == "YES" ]]; then - check_variable "AUTOHOTSPOTssid" - check_variable "AUTOHOTSPOTcountryCode" - check_variable "AUTOHOTSPOTpass" - check_variable "AUTOHOTSPOTip" + if [[ -z "${AUTOHOTSPOTconfig}" ]]; then + echo "INFO: \$AUTOHOTSPOTconfig is missing or not set" + else + if [[ "$AUTOHOTSPOTconfig" == "YES" ]]; then + check_variable "AUTOHOTSPOTssid" + check_variable "AUTOHOTSPOTcountryCode" + check_variable "AUTOHOTSPOTpass" + check_variable "AUTOHOTSPOTip" + fi fi if [ "${fail}" == "true" ]; then