Current section
Files
Jump to
Current section
Files
priv/bin/ntop
#!/bin/bash
usage(){
cat <<- end
usage: [-setcookie <cookie>] [-nocookie] [-nettick <tick>]
[-win] [-dbg] [-vsn <OTP version>] [-proxy proxynode] nodename
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
script=`basename $SPATH`
n=3
while [ 0 -lt "$n" ]; do SPATH=`dirname $SPATH`; let n=n-1; done
ERL=erl
START="-s $script start"
while [ -n "$1" ]
do
case $1 in
"-help"|"-h"|"-?")
usage
;;
"-dbg")
;;
"-win")
WIN="xterm -sb -sl 9999 -bg gold -fg black -e"
;;
"-vsn"|"-version")
shift
VSN="+R "$1
;;
"-nettick"|"-tick")
shift
nettick="-kernel net_ticktime $1"
;;
"-cookie"|"-setcookie")
shift
cookie="-setcookie $1"
;;
"-nocookie")
cookie=""
;;
"-proxy")
shift
proxy="$1"
;;
*)
if [ $# -eq 1 ]; then
TARG=$1
else
usage
fi
;;
esac
shift
done
if [ -z "$TARG" ]; then
usage;
else
START="$START $TARG $proxy"
fi
name=${script}_${$}
FLAGS="-boot start_sasl -sasl errlog_type error +A16"
DISTR="-hidden -sname $name $cookie $nettick"
$WIN erl $VSN $FLAGS $DISTR -pa $SPATH/ebin $START