summaryrefslogtreecommitdiff
path: root/ACE/apps/JAWS/clients/WebSTONE/bin/genfiles-from-filelist.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/apps/JAWS/clients/WebSTONE/bin/genfiles-from-filelist.sh')
-rwxr-xr-xACE/apps/JAWS/clients/WebSTONE/bin/genfiles-from-filelist.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/ACE/apps/JAWS/clients/WebSTONE/bin/genfiles-from-filelist.sh b/ACE/apps/JAWS/clients/WebSTONE/bin/genfiles-from-filelist.sh
new file mode 100755
index 00000000000..1293709238c
--- /dev/null
+++ b/ACE/apps/JAWS/clients/WebSTONE/bin/genfiles-from-filelist.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+
+# get configuration
+[ -n "$WEBSTONEROOT" ] || WEBSTONEROOT=`pwd`/..
+. $WEBSTONEROOT/conf/testbed
+
+case $# in
+ 1)
+ FILELIST=$1
+ ;;
+ *)
+ FILELIST=$WEBSTONEROOT/conf/filelist
+ ;;
+esac
+
+TIMESTAMP=`date +"%y%m%d_%H%M"`
+mkdir $TMPDIR/webstone-genfiles.$TIMESTAMP
+cd $TMPDIR/webstone-genfiles.$TIMESTAMP
+
+cat $FILELIST |
+nawk '
+($3 ~ /^\#[0-9]*/) {
+ sub(/^\#/, "", $3);
+ cmd = WEBSTONEROOT "/bin/genrand " $3 " ."$1
+ print cmd;
+ system(cmd);
+ cmd = RCP " ." $1 " " SERVER ":" WEBDOCDIR
+ print cmd;
+ system(cmd);
+ cmd = "rm -f ." $1
+ print cmd;
+ system(cmd);
+ next
+}
+' $* WEBSTONEROOT=$WEBSTONEROOT RCP=$RCP SERVER=$SERVER WEBDOCDIR=$WEBDOCDIR
+
+cd $TMPDIR
+rm -rf $TMPDIR/webstone-genfiles.$TIMESTAMP
+
+#end