Make the answer case-insensitive
authorChris Sharp <csharp@georgialibraries.org>
Fri, 8 Aug 2014 21:46:28 +0000 (17:46 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Fri, 8 Aug 2014 21:46:28 +0000 (17:46 -0400)
update-libips.sh

index ad448d2..0e0cd95 100755 (executable)
@@ -55,7 +55,7 @@ echo "The new line will be:"
 echo -e "$NEW_SHORTNAME\t$START_IP\t$END_IP"
 echo
 read -p "Is this correct? (y/n) " ANSWER
-if [ "$ANSWER" = "y" ]; then
+if [ "$ANSWER" = "[Yy]" ]; then
        echo "Backing up the original file..."
        cp $LIB_IPS_TXT $LIB_IPS_TXT.`date +%Y%m%d%H%M%S`
        echo "Adding the new entry to the file..."
@@ -85,9 +85,9 @@ EditCopy () {
 cp $LIB_IPS_TXT $LIB_IPS_TXT.`date +%Y%m%d%H%M%S`
 $EDITOR $LIB_IPS_TXT
 read -p "Would you like to copy the file to the other brick heads? (y/n) " COPYFILE
-if [ "$COPYFILE" = "y" ]; then
+if [ "$COPYFILE" = "[Yy]" ]; then
         CopyFile
-elif [ "$COPYFILE" = "n" ]; then
+elif [ "$COPYFILE" = "[Nn]" ]; then
         echo "Not copying file."
         exit;
 else