/
gperf
executable file
·94 lines (86 loc) · 1.78 KB
/
gperf
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
usage(){
cat <<- end
usage: `basename $0` [-setcookie <cookie>] [-nocookie] [-nettick <tick>]
[-pa <path>] [-win] [-dbg] [-vsn <OTP version>] [-proxy proxy] [node]
end
exit
}
if [ ${0:0:1} == "/" ];then
SPATH=$0
elif [ -x $PWD/$0 ];then
SPATH=$PWD/$0
else
SPATH=`which $0`
fi
if [ -L $SPATH ];then
SPATH=`readlink $SPATH`
fi
n=4
while [ 0 -lt "$n" ]; do SPATH=`dirname $SPATH`; let n=n-1; done
PATHS=""
for p in $SPATH/gtknode-*/ebin $SPATH/eper-*/ebin; do
if [ "${p: -7}" == "-*/ebin" ]; then
echo "Can't expand $p.${p: -7}"
else
PATHS=$PATHS" -pa $p"
fi
done
detach="-detached"
VSN=""
START="-s gperf ni"
HALT="-s erlang halt"
XTRA=""
while [ -n "$1" ]
do
case $1 in
"-help"|"-h"|"-?")
usage
;;
"-win")
WIN="xterm -sb -sl 9999 -bg gold -fg black -e"
START="-s gperf start"
HALT=""
detach=""
;;
"-dbg")
START="-s gperf start"
HALT=""
detach=""
;;
"-vsn"|"-version")
shift
VSN="+R $1"
;;
"-nettick"|"-tick")
shift
nettick="-kernel net_ticktime $1"
;;
"-cookie"|"-setcookie")
shift
cookie="-setcookie $1"
;;
"-nocookie")
cookie=""
;;
"-pa")
shift
XTRA="-pa $1 $XTRA"
;;
"-proxy")
shift
proxy="$1"
;;
"-*")
echo dollar_one $1
;;
*)
XTRA="$XTRA $1"
;;
esac
shift
done
name="gperf_"$$
FLAGS="$detach -boot start_sasl -sasl errlog_type error +A16"
DISTR="-hidden -sname $name $cookie $nettick"
$WIN erl $VSN $FLAGS $DISTR $PATHS $START $XTRA $proxy $HALT