Skip to content

Commit

Permalink
add autohotspot config checks (MiczFlor#2091)
Browse files Browse the repository at this point in the history
* add autohotspot config checks

* print info if AUTOHOTSPOTconfig is not set
  • Loading branch information
AlvinSchiller committed Dec 21, 2023
1 parent 7e23dfb commit dd6e5ef
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/installscripts/buster-install-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ check_config_file() {
check_variable "WIFIipRouter"
fi
fi

check_variable "EXISTINGuse"
check_variable "AUDIOiFace"

Expand All @@ -776,6 +777,18 @@ check_config_file() {
check_variable "DIRaudioFolders"
check_variable "GPIOconfig"

# Feature optional. if config not present, defaults to NO
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
exit 1
fi
Expand Down
12 changes: 12 additions & 0 deletions scripts/installscripts/tests/test_installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd6e5ef

Please sign in to comment.