Added ssl fingerprint support for testing purposes
[jimb.git] / jimb
blob4e7826a07f65900da8f88180b8316880c69e4db2
1 #!/bin/sh
2 COMMAND=$1
3 echo "JIMB - (c)2010 Martin Kelm"
5 if [ X"$COMMAND" = X"start" ]; then
6 if [ -f jimb.pid ]; then
7 echo "Bot is already running!"
8 else
9 nohup ./jimci-loop 2>&1 >jimb.log &
10 PID=`ps -ef | grep jimci-loop | grep -v grep | awk '{ print $2 }'`
11 echo $PID >jimb.pid
12 echo "Bot started (PID $PID)"
14 elif [ X"$COMMAND" = X"stop" ]; then
15 kill -9 `cat jimb.pid`
16 rm jimb.pid
17 echo "Bot stopped"
18 elif [ X"$COMMAND" = X"restart" ]; then
19 $0 stop
20 $0 start
21 echo "Bot restarted"