make the arguments case insensitive i.e. allow test or TEST

r1961 | dcl | 2007-05-15 12:31:22 +1000 (Tue, 15 May 2007) | 2 lines
This commit is contained in:
Douglas Clowes
2007-05-15 12:31:22 +10:00
parent a181e68d36
commit 1eb1698d79

View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# $Revision: 1.24 $ # $Revision: 1.25 $
# $Date: 2007-05-11 07:29:57 $ # $Date: 2007-05-15 02:31:22 $
# Author: Ferdi Franceschini (ffr@ansto.gov.au) # Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Last revision by $Author: dcl $ # Last revision by $Author: dcl $
@@ -54,7 +54,9 @@ copy_server_config() {
fi fi
} }
if [ "$1" = "-n" ] shopt -s nocasematch
if [[ "$1" = "-n" ]]
then then
DEPLOY="NO" DEPLOY="NO"
shift shift
@@ -70,7 +72,7 @@ fi
TESTING=$(dirname "$1") TESTING=$(dirname "$1")
INSTRUMENT=$(basename "$1") INSTRUMENT=$(basename "$1")
if [ "$INSTRUMENT" = "test" ] if [[ "$INSTRUMENT" = "test" ]]
then then
TESTING=$(basename "$1") TESTING=$(basename "$1")
INSTRUMENT=$(dirname "$1") INSTRUMENT=$(dirname "$1")
@@ -123,7 +125,7 @@ INSTCFDIR=$INSTSRC/config
make -C ../ $INSTRUMENT || exit $? make -C ../ $INSTRUMENT || exit $?
if [ "$TESTING" = "test" ] if [[ "$TESTING" = "test" ]]
then then
DESTHOST=${2:-ics1-test.nbi.ansto.gov.au} DESTHOST=${2:-ics1-test.nbi.ansto.gov.au}
DESTDIR=${3:-/usr/local}/TEST_SICS/$INSTRUMENT DESTDIR=${3:-/usr/local}/TEST_SICS/$INSTRUMENT
@@ -148,7 +150,7 @@ fi
echo "Deploying $INSTRUMENT to $DESTHOST:$DESTDIR" echo "Deploying $INSTRUMENT to $DESTHOST:$DESTDIR"
if [ "$DESTHOST" = "localhost" ] if [[ "$DESTHOST" = "localhost" ]]
then then
EXTRACT="tar vxzp -C /" EXTRACT="tar vxzp -C /"
EXTRACT_NODEPLOY="tar vxzp -C /" EXTRACT_NODEPLOY="tar vxzp -C /"
@@ -204,7 +206,7 @@ find $TARDIR -type f -perm -100 -exec chmod go+x {} \;
find $TARDIR -type d -exec chmod u+rwx,g+rwxs,o-w+rx {} \; find $TARDIR -type d -exec chmod u+rwx,g+rwxs,o-w+rx {} \;
# Strip leading / from DESTDIR and extract to destination # Strip leading / from DESTDIR and extract to destination
if [ "$DEPLOY" = "YES" ] if [[ "$DEPLOY" = "YES" ]]
then then
tar -cz $TARDIR | $EXTRACT tar -cz $TARDIR | $EXTRACT
else else