Репозитории ALT
S: | 1.9.5-alt1 |
5.1: | 1.6.19-alt2 |
4.1: | 1.6.19-alt1.M41.1 |
4.0: | 1.6.19-alt1.M40.1 |
3.0: | 1.6.17-alt2 |
Другие репозитории
Upstream: | 1.6.18 |
Группа :: Сети/IRC
Пакет: eggdrop
Главная Изменения Спек Патчи Исходники Загрузить Gear Bugs and FR Repocop
#!/bin/sh
#
# eggdrop Eggdrop is an IRC bot, written in C
#
# chkconfig: - 90 10
# description: Eggdrop is an IRC bot, written in C
# processname: eggdrop
# config: /etc/eggdrop.conf
# pidfile: /var/run/eggdrop/eggdrop.pid
# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
PIDFILE=/var/run/eggdrop/eggdrop.pid
LOCKFILE=/var/lock/subsys/eggdrop
BINARY=/var/lib/eggdrop/eggdrop.conf
RUNAS=_eggdrop
SourceIfNotEmpty /etc/sysconfig/eggdrop
RETVAL=0
check()
{
USERFILE=$(egrep "set userfile " /var/lib/eggdrop/eggdrop.conf |cut -d ' ' -f3 |sed -e "s/\"//g")
[ -e /var/lib/eggdrop/"$USERFILE" ] && continue || NEED_USERFILE=1
}
start()
{
check
[ "$NEED_USERFILE" = 1 ] && OPTIONS="-m" ||:
[ "$NEED_USERFILE" = 1 ] && echo "STARTING BOT IN USERFILE CREATION MODE.
Telnet to the bot and enter 'NEW' as your nickname.
OR go to IRC and type: /msg Lamestbot hello
This will make the bot recognize you as the master."
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --displayname eggdrop \
--user "$RUNAS" -- "$BINARY" "$OPTIONS"
RETVAL=$?
return $RETVAL
}
stop()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --displayname eggdrop \
--expect-user "$RUNAS" -- eggdrop
RETVAL=$?
return $RETVAL
}
restart()
{
stop
start
}
reload()
{
restart
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
condreload)
if [ -e "$LOCKFILE" ]; then
reload
fi
;;
status)
status --pidfile "$PIDFILE" --expect-user "$RUNAS" -- eggdrop
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
RETVAL=1
esac
exit $RETVAL