-
Notifications
You must be signed in to change notification settings - Fork 0
/
W3CServerStateStorage.sh
executable file
·60 lines (53 loc) · 1.16 KB
/
W3CServerStateStorage.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
#!/bin/bash
services=(server_core service_mgr at_server agt_server http_mgr ws_mgr)
usage() {
# echo "usage: $0 startme|stopme|configureme" >&2
echo "usage: $0 startme|stopme" >&2
}
startme() {
for service in "${services[@]}"; do
echo "Starting $service"
mkdir -p logs
if [ $service == "service_mgr" ]; then
screen -S $service -dm bash -c "pushd server/$service && go build && mkdir -p logs && ./$service --dbfile statestorage.db &> ./logs/$service-log.txt && popd"
else
screen -S $service -dm bash -c "pushd server/$service && go build && mkdir -p logs && ./$service &> ./logs/$service-log.txt && popd"
fi
if [ $service == "server_core" ]; then
sleep 5s
fi
popd
done
screen -list
}
stopme() {
for service in "${services[@]}"; do
echo "Stopping $service"
screen -X -S $service quit
killall -9 $service
done
screen -wipe
}
#configureme() {
#ln -s <absolute-path-to-dir-of-git-root>/WAII/server/Go/server-1.0/vendor/utils $GOPATH/src/utils
#}
if [ $# -ne 1 ]
then
usage $0
exit 1
fi
case "$1" in
startme)
stopme
startme ;;
stopme)
stopme
;;
#configureme)
# configureme
# ;;
*)
usage
exit 1
;;
esac