Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / ACE / apps / JAWS / clients / WebSTONE / bin / genfiles-from-filelist.sh
blobe0e501305f5990d7c89b449f6ba8a9b4c300b152
1 #!/bin/sh
3 # get configuration
4 [ -n "$WEBSTONEROOT" ] || WEBSTONEROOT=`pwd`/..
5 . $WEBSTONEROOT/conf/testbed
7 case $# in
8 1)
9 FILELIST=$1
12 FILELIST=$WEBSTONEROOT/conf/filelist
14 esac
16 TIMESTAMP=`date +"%y%m%d_%H%M"`
17 mkdir $TMPDIR/webstone-genfiles.$TIMESTAMP
18 cd $TMPDIR/webstone-genfiles.$TIMESTAMP
20 cat $FILELIST |
21 nawk '
22 ($3 ~ /^\#[0-9]*/) {
23 sub(/^\#/, "", $3);
24 cmd = WEBSTONEROOT "/bin/genrand " $3 " ."$1
25 print cmd;
26 system(cmd);
27 cmd = RCP " ." $1 " " SERVER ":" WEBDOCDIR
28 print cmd;
29 system(cmd);
30 cmd = "rm -f ." $1
31 print cmd;
32 system(cmd);
33 next
35 ' $* WEBSTONEROOT=$WEBSTONEROOT RCP=$RCP SERVER=$SERVER WEBDOCDIR=$WEBDOCDIR
37 cd $TMPDIR
38 rm -rf $TMPDIR/webstone-genfiles.$TIMESTAMP
40 #end