Created
December 29, 2010 22:39
-
-
Save andrewwatts/759163 to your computer and use it in GitHub Desktop.
/etc/init.d/hybserv and postinst from hybserv deb package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# hybserv Start/stop Hybserv 2 IRC Services | |
# Version: hybserv 1.8.0 17-Mar-2003 [email protected] | |
# Version: hybserv 1.9.2 05-Sep-2006 [email protected] | |
### BEGIN INIT INFO | |
# Provides: hybserv | |
# Required-Start: $syslog ircd-hybrid | |
# Required-Stop: $syslog ircd-hybrid | |
# Should-Start: $local_fs $network $named | |
# Should-Stop: $local_fs $network $named | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Hybserv daemon init.d script | |
# Description: Use to manage the Hybserv daemon. | |
### END INIT INFO | |
PATH=/sbin:/bin:/usr/sbin:/usr/bin | |
NAME=hybserv | |
DAEMON=/usr/local/hybserv/hybserv | |
PID=/usr/local/hybserv/$NAME.pid | |
CONF=/usr/local/hybserv/hybserv.conf | |
DESC="Hybserv 2 IRC Services" | |
test -f $DAEMON || exit 0 | |
set -e | |
if [ "$1" = "start" ] || [ "$1" = "restart" ] || [ "$1" = "force-reload" ]; then | |
if [ ! `grep '#NOT-EDITED#' $CONF | wc -l` -eq 0 ]; then | |
echo "Not starting $DESC: please edit $CONF first..." | |
exit 0 | |
fi | |
fi | |
case "$1" in | |
start) | |
echo -n "Starting $DESC: $NAME" | |
if [ -f "$PID" ]; then | |
echo " already running, if this is not the case, then call 'stop' first." | |
else | |
start-stop-daemon --start --quiet \ | |
-u irc -c irc --exec $DAEMON >/dev/null 2>&1 | |
fi | |
echo "." | |
;; | |
stop) | |
echo -n "Stopping $DESC: $NAME" | |
if [ -f "$PID" ]; then | |
start-stop-daemon -K -p $PID -s 15 -q --oknodo | |
rm -f $PID | |
else | |
echo " ... not running!" # This is abnormal, please file a bug report. | |
fi | |
echo "." | |
;; | |
reload) | |
if [ -f "$PID" ]; then | |
echo -n "Reloading configuration files for $NAME..." | |
kill -HUP `cat $PID` | |
echo "done." | |
else | |
echo "Not reloading configuration files for $NAME - not running!" | |
fi | |
;; | |
restart|force-reload) | |
echo -n "Restarting $DESC: $NAME" | |
if [ -f "$PID" ]; then | |
start-stop-daemon -K -p $PID -s 15 -q --oknodo | |
sleep 1 | |
fi | |
start-stop-daemon --start --quiet \ | |
-u irc -c irc --exec $DAEMON \ | |
>/dev/null 2>&1 | |
echo "." | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 | |
exit 1 | |
;; | |
esac | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# Show the first time notice | |
. /usr/share/debconf/confmodule | |
# Fixing potential fallout from 1.8.0-1... | |
chown irc:irc /etc/hybserv | |
db_stop | |
# Automatically added by dh_installinit | |
if [ -x "/etc/init.d/hybserv" ]; then | |
update-rc.d hybserv defaults 21 >/dev/null | |
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then | |
invoke-rc.d hybserv start || exit $? | |
else | |
/etc/init.d/hybserv start || exit $? | |
fi | |
fi | |
# End automatically added section |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment