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"