diff options
Diffstat (limited to 'office/dictd/config/rc.dictd')
-rw-r--r-- | office/dictd/config/rc.dictd | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/office/dictd/config/rc.dictd b/office/dictd/config/rc.dictd new file mode 100644 index 0000000000..047c6c0cbd --- /dev/null +++ b/office/dictd/config/rc.dictd @@ -0,0 +1,71 @@ +#!/bin/sh +# script courtesy of Sergio Vicari <sercari@esdebian.org> + +DICTD=/usr/sbin/dictd + +# DICTD_OPTIONS="-put -command_line -options -for -dictd -here" +DICTD_OPTIONS="" + + +PIDFILE=/var/run/dictd.pid + +start() { + + if [ -x $DICTD ]; then + echo "dictd starting." + $DICTD $DICTD_OPTIONS + else + echo "rc.dictd: cannot find $DICTD or it's not executable" + fi +} + +stop() { + if [ -e "$PIDFILE" ]; then + echo "Stopping the dictd server." + pid=$(cat $PIDFILE) + kill $pid 1> /dev/null 2> /dev/null + # Just in case: + killall dictd 1> /dev/null 2> /dev/null + rm -f $PIDFILE + fi +} +reload() { + echo "Reloading dictd." + if [ -e "$PIDFILE" ]; then + pid=$(cat $PIDFILE) + kill -HUP $pid + else + killall -HUP dictd + fi +} + +status() { + if [ -e /var/run/dictd.pid ]; then + echo "the dictd server is running." + else + echo "dictd server is stopped." + fi +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + reload) + reload + ;; + status) + status + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|status}" + ;; +esac |