From 83c13f1181c4062ca5296ea956e950064bde0ffe Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 18 Oct 2012 13:38:58 +0200 Subject: o Making all scripts be run from the root/ directory. Do not assume you're in current/. --- test/data/app-a/root/bin/app-a | 11 ++++++----- test/data/app-a/scripts/postinstall | 18 ++++++++++++++---- 2 files changed, 20 insertions(+), 9 deletions(-) (limited to 'test/data/app-a') diff --git a/test/data/app-a/root/bin/app-a b/test/data/app-a/root/bin/app-a index c8c4fc5..98d98cd 100644 --- a/test/data/app-a/root/bin/app-a +++ b/test/data/app-a/root/bin/app-a @@ -1,15 +1,16 @@ #!/bin/bash -me=$APPSH_INSTANCE_HOME/`basename $0` +#cd $APPSH_INSTANCE_HOME +me=`basename $0` -echo "Starting" >> $me.log +env | grep TEST_PROPERTY >> logs/$me.env -env | grep TEST_PROPERTY > $me.env +echo "Starting" >> logs/$me.log for i in {1..10} do - echo "#$i: `date`" >> $me.log + echo "#$i: `date`" >> logs/$me.log sleep 1 done -echo "Exiting" >> $me.log +echo "Exiting" >> logs/$me.log diff --git a/test/data/app-a/scripts/postinstall b/test/data/app-a/scripts/postinstall index a77f86f..c1a0cf1 100644 --- a/test/data/app-a/scripts/postinstall +++ b/test/data/app-a/scripts/postinstall @@ -1,11 +1,21 @@ -#!/bin/bash +#!/bin/bash -e echo "Hello World!" -if [ -d root/etc/$APPSH_INSTANCE ] +if [ -d etc/$APPSH_INSTANCE ] then - find root/etc/$APPSH_INSTANCE -type f -maxdepth 1 | while read file + find etc/$APPSH_INSTANCE -type f -maxdepth 1 | while read file do - cp $file root/ + cp $file . done fi + +LOGS=$APPSH_APPS/$APPSH_NAME/$APPSH_INSTANCE/logs + +if [ ! -d $LOGS ] +then + echo "Creating logs directory" + mkdir $LOGS +fi + +ln -s $LOGS logs -- cgit v1.2.3