-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwisechat.sh
More file actions
executable file
·41 lines (32 loc) · 833 Bytes
/
wisechat.sh
File metadata and controls
executable file
·41 lines (32 loc) · 833 Bytes
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
#!/bin/sh
##
## usage web_server.sh {start|stop|debug}
##
## PA = path to the web server
## PORT = port to run as
PA="ebin deps/*/ebin" # $HOME/tutorials/dev/web_server
PORT=8008
ERL=erl
HOSTNAME=`hostname`
export HEART_COMMAND="./web_server.sh start"
case $1 in
start)
echo "Starting WiseChat"
$ERL -boot start_sasl -name wisechat001@$HOSTNAME -pa $PA \
-heart -detached -s wisechat start_work $PORT
;;
debug)
echo "Starting WiseChat in console mode"
$ERL -name wisechat001$@HOSTNAME -pa $PA \
-noshell -s wisechat start_work $PORT
;;
stop)
echo "Stopping WiseChat"
$ERL -noshell -name wisechat001_stopper@$HOSTNAME -pa $PA \
-s wisechat stop_work wisechat001@$HOSTNAME
;;
*)
echo "Usage: $0 {start|stop|debug}"
exit 1
esac
exit 0