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)"
|
echo "Is this a server or workstation? (s/w)"
|
||||||
tput sgr0
|
tput sgr0
|
||||||
|
|
||||||
read systemType
|
while true; do
|
||||||
while [[ $systemType != "s" && $systemType != "w" ]]; do
|
read -p "(s/w): " systemType
|
||||||
echo "Invalid input. Please enter 's' for server or 'w' for workstation:"
|
if [[ $systemType == "s" || $systemType == "w" ]]; then
|
||||||
read systemType
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Invalid input. Please enter 's' for server or 'w' for workstation."
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
if [ $systemType == "s" ]; then
|
if [ $systemType == "s" ]; then
|
||||||
isServer="true"
|
isServer="true"
|
||||||
isWorkstation="false"
|
isWorkstation="false"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user