-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·70 lines (57 loc) · 1.06 KB
/
run.sh
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
70
#!/bin/bash
#### BEGIN VAN OPTIES ###
# portnummer voor je browser: http://localhost:$port/
port=8234
# waar alle data wordt opgeslagen
# (het path naar) deze directory moet leesbaar zijn voor docker (voor iedereen?)
data=$HOME/.var/AlpinoGraph
#### EINDE VAN OPTIES ####
case "`docker info --format '{{.SecurityOptions}}'`" in
*name=rootless*)
USER=0
GROUP=0
;;
*)
USER=`id -u`
GROUP=`id -g`
;;
esac
image=registry.webhosting.rug.nl/compling/alpinograph:latest
case "$1" in
run)
;;
upgrade)
docker pull $image
exit
;;
*)
echo
echo "Gebruik:"
echo
echo " $0 run"
echo " $0 upgrade"
echo
exit
esac
if [ ! -d "$data" ]
then
mkdir -p "$data"
fi
if [ ! -d "$data" ]
then
echo Directory $data kon niet gemaakt worden
exit
fi
# xdg-open http://localhost:$port/ &> /dev/null &
echo
echo AlpinoGraph wordt gestart op http://localhost:$port/
echo
docker run \
--rm \
-i -t \
-h alpinograph.`hostname -d` \
-e USER=$USER \
-e GROUP=$GROUP \
-p $port:80 \
-v $data:/home/user \
$image