improves input validation in create_hardware_config function
This commit is contained in:
parent
36cb9bbb42
commit
7ba5ab2067
12
setup.sh
12
setup.sh
@ -56,12 +56,16 @@ create_hardware_config() {
|
||||
echo "Is this a server or workstation? (s/w)"
|
||||
tput sgr0
|
||||
|
||||
read systemType
|
||||
while [[ $systemType != "s" && $systemType != "w" ]]; do
|
||||
echo "Invalid input. Please enter 's' for server or 'w' for workstation:"
|
||||
read systemType
|
||||
while true; do
|
||||
read -p "(s/w): " systemType
|
||||
if [[ $systemType == "s" || $systemType == "w" ]]; then
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Invalid input. Please enter 's' for server or 'w' for workstation."
|
||||
done
|
||||
|
||||
|
||||
if [ $systemType == "s" ]; then
|
||||
isServer="true"
|
||||
isWorkstation="false"
|
||||
|
Loading…
x
Reference in New Issue
Block a user