Fix but adding locales
authorAndy Witter <awitter@georgialibraries.org>
Fri, 1 Sep 2017 23:33:44 +0000 (19:33 -0400)
committerAndy Witter <awitter@georgialibraries.org>
Fri, 1 Sep 2017 23:33:44 +0000 (19:33 -0400)
templates/setup-head.sh

index 99e1483..9581f67 100755 (executable)
@@ -159,16 +159,16 @@ then
         echo "Setting up custom locales..."
         for LOCALE_FILE in $LOCALE_DIR/*
         do
-                LOCALE="$(cat $LOCALE_FILE | awk -F'"' '{ print $2 }')"
-                if grep -q "$LOCALE_FILE" $EG_VHOST
+               LOCALE="$(echo $LOCALE_FILE | awk -F"/" '{ print $7 }' | awk -F"." '{ print $1 }' | tr '[:upper:]' '[:lower:]')"
+                if grep "$LOCALE_FILE" $EG_VHOST | grep -qv '#'
                 then
-                        sleep 2
+                        sleep 1
                         echo
                         echo "Locale $LOCALE already configured in $EG_VHOST"
                         echo "not adding it again."
                 else
                         #LOCALE="$(cat $LOCALE_FILE | awk -F'"' '{ print $2 }')"
-                        sleep 2
+                        sleep 1
                         echo
                         echo "Found $LOCALE_FILE Locale for this file is: $LOCALE"
                         sed -i "/#PerlAddVar OILSWebLocale \"\/openils\/var\/data\/locale\/opac\/fr-CA.po\"/a \     \PerlAddVar OILSWebLocale \"${LOCALE_FILE}\"" "$EG_VHOST"