summaryrefslogtreecommitdiffstats
path: root/deployment/funcs_jnlp_relocate.sh
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-11-09 06:49:09 +0100
committerSven Gothel <[email protected]>2010-11-09 06:49:09 +0100
commit904d059ddeb346bd07beaefb5542e2f9374378be (patch)
tree01a56869bb3213f16137e870f41aacb6553f5438 /deployment/funcs_jnlp_relocate.sh
parent9105b459073a000f081f2e939ae5fa127eda69b0 (diff)
Add generic jnlp relocate script
Diffstat (limited to 'deployment/funcs_jnlp_relocate.sh')
-rwxr-xr-xdeployment/funcs_jnlp_relocate.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/deployment/funcs_jnlp_relocate.sh b/deployment/funcs_jnlp_relocate.sh
new file mode 100755
index 0000000..2045a1f
--- /dev/null
+++ b/deployment/funcs_jnlp_relocate.sh
@@ -0,0 +1,41 @@
+#! /bin/bash
+
+function copy_relocate_jnlps() {
+
+url=$1
+shift
+
+wsdir=$1
+shift
+
+if [ -z "$url" -o -z "$wsdir" ] ; then
+ echo usage $0 codebase-url webstartdir
+ echo Examples
+ echo sh $0 file:////usr/local/projects/JOGL/webstart ../../webstart
+ echo sh $0 http://domain.org/jogl/webstart /srv/www/webstart-next
+ exit 1
+fi
+
+if [ ! -e $wsdir ] ; then
+ echo $wsdir does not exist
+ exit 1
+fi
+
+jnlpdir=$wsdir/jnlp-files
+
+if [ ! -e $jnlpdir ] ; then
+ echo $jnlpdir does not exist
+ exit 1
+fi
+
+cp -v $jnlpdir/*.html $wsdir
+
+uri_esc=`echo $url | sed 's/\//\\\\\//g'`
+for j in $jnlpdir/*.jnlp ; do
+ jb=`basename $j`
+ echo "processing $j to $wsdir/$jb"
+ sed "s/CODEBASE_TAG/$uri_esc/g" \
+ $j > $wsdir/$jb
+done
+
+}