summaryrefslogtreecommitdiffstats
path: root/deployment/funcs_jnlp_relocate.sh
blob: d529639d0cbdab316251d6b64497b7f5a16a947e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#! /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 -e "s/JOGL_CODEBASE_TAG/$uri_esc/g" \
        -e "s/GLUEGEN_CODEBASE_TAG/$uri_esc/g" \
        -e "s/JOCL_CODEBASE_TAG/$uri_esc/g" \
        -e "s/DEMO_CODEBASE_TAG/$uri_esc/g" \
        $j > $wsdir/$jb
done

}

function remove_security_tag_jnlps() {

wsdir=$1
shift 

if [ -z "$wsdir" ] ; then
    echo usage $0 webstartdir
    exit 1
fi

if [ ! -e $wsdir ] ; then
    echo $wsdir does not exist
    exit 1
fi

cd $wsdir

for i in *.jnlp ; do
    sed -i -e 's/<security>//g' -e 's/<\/security>//g' -e 's/<all-permissions\/>//g' $i
done

}