[Swift-commit] r7258 - trunk/bin
davidk at ci.uchicago.edu
davidk at ci.uchicago.edu
Thu Oct 31 16:48:45 CDT 2013
Author: davidk
Date: 2013-10-31 16:48:45 -0500 (Thu, 31 Oct 2013)
New Revision: 7258
Modified:
trunk/bin/gensites
Log:
Add ability to update a pool name (-n)
Modified: trunk/bin/gensites
===================================================================
--- trunk/bin/gensites 2013-10-31 18:59:55 UTC (rev 7257)
+++ trunk/bin/gensites 2013-10-31 21:48:45 UTC (rev 7258)
@@ -75,6 +75,7 @@
-L) TEMPLATE_DIRECTORY=$2; verify_not_null template_directory $TEMPLATE_DIRECTORY; shift ;;
-l) LIST_SPECIFIC_TEMPLATE=1 ;;
-T) LIST_TEMPLATES=1 ;;
+ -n) NEW_TEMPLATE_NAME=$2; verify_not_null new_template_name $NEW_TEMPLATE_NAME; shift ;;
-h|-help|-?) usage ;;
*) TEMPLATE=$1 ;;
esac
@@ -151,14 +152,7 @@
fi
# Setup for creating a TC file
-if [ -f "$PROPERTIES_FILE" ]; then
- if [ -n "`grep -e app $PROPERTIES_FILE`" ]; then
- #if [ -f "tc.data" ]; then
- # mv tc.data tc.data.old
- #fi
- HOSTS=`grep -i "pool handle" $TEMPLATE_PATH|grep -v "^[[:space:]]*#"|cut -d'"' -f2`
- fi
-fi
+HOSTS=`grep -i "pool handle" $TEMPLATE_PATH|grep -v "^[[:space:]]*#"|cut -d'"' -f2`
# Parse values into variables for later sed processing
if [ -f "$PROPERTIES_FILE" ]; then
@@ -214,10 +208,10 @@
fi
SED_COMMAND+="-e s@"\_$value\_"@${!value}@g "
done
+SED_COMMAND+=" -e s@\"$HOSTS\"@\"$NEW_TEMPLATE_NAME\"@g "
len=$( echo $SED_COMMAND |wc -w )
if [ $len -gt 1 ]; then
$SED_COMMAND $TEMPLATE_PATH
else
cat $TEMPLATE_PATH
fi
-
More information about the Swift-commit
mailing list