diff --git a/installation/components/setup_hifiberry.sh b/installation/components/setup_hifiberry.sh index d15cc5476..981157696 100644 --- a/installation/components/setup_hifiberry.sh +++ b/installation/components/setup_hifiberry.sh @@ -89,7 +89,7 @@ main() { # Execute program if [ $# -ge 1 ]; then - if [[ "$1" != "enable" && "$1" != "disable" ]] || [[ "$1" == "enable" && -z $# -ge 2 ]]; then + if [[ "$1" != "enable" && "$1" != "disable" ]] || [[ "$1" == "enable" &&-z "$2" ]]; then echo "Error: Invalid arguments provided. Usage: ./${script_name} where can be 'enable' or 'disable'. @@ -99,11 +99,6 @@ The following board options exist:" exit 1 fi - if [ "$1" == "disable" ]; then - disable_hifiberry - exit 1 - fi - if [ "$1" == "enable" ]; then case "$2" in "${hifiberry_map[@]}") @@ -115,6 +110,11 @@ The following board options exist:" ;; esac fi + + if [ "$1" == "disable" ]; then + disable_hifiberry + exit 1 + fi fi main