5
# Required-Start: $local_fs $remote_fs $network $named
6
# Required-Stop: $local_fs $remote_fs
7
# Default-Start: 2 3 4 5
9
# Short-Description: Gozerbot IRC and Jabber bot
10
# Description: Gozerbot is an IRC and Jabber bot written in Python.
14
DESC="Gozerbot IRC robot"
15
DATADIR=/var/lib/gozerbot
16
PIDFILE=$DATADIR/gozerbot.pid
17
LOGFILE=/var/log/gozerbot.log
19
PID=`cat $PIDFILE` 2>/dev/null
21
# Include gozerbot defaults if available
22
if [ -f /etc/default/gozerbot ] ; then
23
. /etc/default/gozerbot
26
if [ "$RUN" != "yes" ] ; then
27
echo "$NAME disabled; edit /etc/default/gozerbot"
31
if [ -z "$RUNUSER" ] ; then
37
test -n "$PID" && ps auxw | grep -v grep | grep gozerbot | grep -q -s " $PID " && return 0
51
status && exit 1 # already running
59
if [ -e gozerdata/mainconfig ]
61
su $RUNUSER -c "$NAME >> /var/log/gozerbot.log 2>&1 &"
63
su $RUNUSER -c gozerbot-init
65
ln -s /var/lib/gozerbot/gozerdata /etc/gozerbot
67
echo "A default config file /etc/gozerbot/mainconfig has been created."
68
echo "irc and jabber bot example files are installed in /etc/gozerbot/fleet."
69
echo "Please edit those files and then run this script again to start gozerbot."
75
echo -n "Starting $DESC: $NAME"
78
0) echo "." ; exit 0 ;;
79
1) echo " (already running)." ; exit 0 ;;
80
*) echo " (failed)." ; exit 1 ;;
84
echo -n "Stopping $DESC: $NAME"
87
0) echo "." ; exit 0 ;;
88
1) echo " (not running)." ; exit 0 ;;
89
*) echo " (failed)." ; exit 1 ;;
92
restart|force-reload|reload)
93
echo -n "Restarting $DESC: $NAME"
98
echo -n "Status of $DESC service: "
101
0) echo "running." ; exit 0 ;;
102
1) echo "not running." ; exit 3 ;;
106
echo "Usage: /etc/init.d/gozerbot {start|stop|reload|force-reload|restart|status}" >&2