mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-03-27 02:01:53 +01:00
make boolean options have the same value (#2912)
This commit is contained in:
parent
b6a106d5d7
commit
082b52f143
@ -55,6 +55,10 @@ assign_value(){
|
||||
-*) value="${2#-}";;
|
||||
*) value="${2}"
|
||||
esac
|
||||
case "${value}" in
|
||||
0) value="false";;
|
||||
1) value="true";;
|
||||
esac
|
||||
## Escaping quotes is needed because else if will fail if the argument is quoted
|
||||
# shellcheck disable=SC2140
|
||||
eval "${1}"="\"${value}\""
|
||||
@ -116,9 +120,16 @@ range_argument(){
|
||||
fi
|
||||
}
|
||||
|
||||
echo -e "\n*** SOFTWARE UPDATE ***"
|
||||
general_utils="curl"
|
||||
sudo apt install -y ${general_utils}
|
||||
## loop all general_utils to see if program is installed (placed on PATH) and if not, add to the list of commands to be installed
|
||||
for prog in ${general_utils}; do
|
||||
! command -v ${prog} >/dev/null && general_utils_install="${general_utils_install} ${prog}"
|
||||
done
|
||||
## if any of the required programs are not installed, update and if successfull, install packages
|
||||
if [ -n "${general_utils_install}" ]; then
|
||||
echo -e "\n*** SOFTWARE UPDATE ***"
|
||||
sudo apt update -y && sudo apt install -y ${general_utils_install}
|
||||
fi
|
||||
|
||||
## use default values for variables if empty
|
||||
|
||||
@ -131,7 +142,7 @@ range_argument interaction "0" "1" "false" "true"
|
||||
|
||||
# FATPACK
|
||||
# -------------------------------
|
||||
# could be 'true' (default) or 'false'
|
||||
# could be 'true' (default) or 'false'
|
||||
# When 'true' it will pre-install needed frameworks for additional apps and features
|
||||
# as a convenience to safe on install and update time for additional apps.
|
||||
# When 'false' it will just install the bare minimum and additional apps will just
|
||||
@ -179,7 +190,7 @@ echo "* RASPIBLITZ SD CARD IMAGE SETUP *"
|
||||
echo "*****************************************"
|
||||
echo "For details on optional parameters - call with '--help' or check source code."
|
||||
|
||||
# output
|
||||
# output
|
||||
for key in interaction fatpack github_user branch display tweak_boot_drive wifi_region; do
|
||||
eval val='$'"${key}"
|
||||
[ -n "${val}" ] && printf '%s\n' "${key}=${val}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user