Add a command line option for those of us who value their time
authorAndy Witter <awitter@georgialibraries.org>
Tue, 17 Dec 2019 22:22:53 +0000 (17:22 -0500)
committerAndy Witter <awitter@georgialibraries.org>
Tue, 17 Dec 2019 22:22:53 +0000 (17:22 -0500)
GenaSYS.sh

index 1c70b0b..8edfd2c 100755 (executable)
@@ -18,7 +18,6 @@
 
 
 ##########################################################################
-
 # ########################################################################
 
        NAME_="GenaSYS"
    COMMENTS_="Generates system and opensrf config files for Evergreen clusters"
 
 # #############################################################################
-
 Usage () { ### Display Usage
 echo ; echo >&2 "Usage: $0 [-c config file] [-h] help" ; echo
 }
 
-while getopts c:nh OPTIONS
+dont_waste_my_time() {
+       sleep() {
+               echo
+       }
+}
+while getopts c:nhd OPTIONS
 do     case "$OPTIONS" in
        c)      CONFIG_FILE="$OPTARG";;
        n)      NOSPLASH="1";;
+       d)      NOSPLASH="1";BLOW_PAST="1";dont_waste_my_time;;
        h)      Usage ; exit 1;;
        [?])    Usage ; exit 2;;
        esac
@@ -182,6 +186,7 @@ echo
 echo "[1] - I ACCEPT the terms of this license."
 echo "[2] - I DO NOT ACCEPT the terms of this license."
 echo
+
 select yn in "Yes" "No"; do
     case $yn in
         Yes ) echo ; echo -e $COL_BR_GREEN" License accepted..."$COL_RESET; sleep 1 ; break;;
@@ -236,7 +241,7 @@ echo
 echo "Please read the following installation notes or"
 echo "you're gonna be real messed up...."
 echo -e $COL_RESET
-read -p "Press [Enter] to continue" ENTER
+[ "$BLOW_PAST" == "1" ] || read -p "Press [Enter] to continue" ENTER
 echo
 echo -e ${COL_BR_CYAN}"1 __Library IP based redirection:"$COL_RESET
 echo "If you are going be using Library based redirection then"
@@ -292,7 +297,7 @@ echo -e "to the"${COL_YELLOW} "${CUSTOMDIR}" ${COL_RESET} directory.
 sleep 3
 echo
 echo -e "Press ${COL_BR_CYAN}[Enter]${COL_RESET} to continue or ${COL_BR_CYAN}[Ctrl-C]${COL_RESET} to quit now" 
-read -p "if you need to do any of the above." ENTER
+[ "$BLOW_PAST" == "1" ] || read -p "if you need to do any of the above." ENTER