diff options
-rwxr-xr-x | scripts/install-system | 10 | ||||
-rwxr-xr-x | scripts/install/install-functions | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/scripts/install-system b/scripts/install-system index 64e2915f..4281fc8d 100755 --- a/scripts/install-system +++ b/scripts/install-system @@ -101,18 +101,22 @@ turnoffswap () { fi } +tolower () { + echo "$*" | tr '[:upper:]' '[:lower:]' +} + # Validates a user response. Returns the response if valid. # Returns the default is the user just hits enter. # Returns nothing if not valid. Default parameter is $1. # Options are in $2. If options are defined return must be a member # of the enum. get_response () { - ldefault=$(echo "$1" | tr [:upper:] [:lower:]) - loptions=$(echo "$2" | tr [:upper:] [:lower:]) + local ldefault=$(tolower "$1") + local loptions=$(tolower "$2") # get the response from the user read myresponse - myresponse=$(echo "$myresponse" | tr [:upper:] [:lower:]) + myresponse=$(tolower "$myresponse") # Check to see if the user accepts the default if [ -z "$myresponse" ]; then diff --git a/scripts/install/install-functions b/scripts/install/install-functions index ff4d6f48..ffaea22d 100755 --- a/scripts/install/install-functions +++ b/scripts/install/install-functions @@ -83,18 +83,22 @@ becho () echo -e "$*" } +tolower () { + echo "$*" | tr '[:upper:]' '[:lower:]' +} + # Validates a user response. Returns the response if valid. # Returns the default is the user just hits enter. # Returns nothing if not valid. Default parameter is $1. # Options are in $2. If options are defined return must be a member # of the enum. get_response () { - ldefault=$(echo "$1" | tr [:upper:] [:lower:]) - loptions=$(echo "$2" | tr [:upper:] [:lower:]) + local ldefault=$(tolower "$1") + local loptions=$(tolower "$2") # get the response from the user read myresponse - myresponse=$(echo "$myresponse" | tr [:upper:] [:lower:]) + myresponse=$(tolower "$myresponse") # Check to see if the user accepts the default if [ -z "$myresponse" ]; then |