diff options
author | sercari <sercari@esdebian.org> | 2010-05-13 01:00:30 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-13 01:00:30 +0200 |
commit | 4db9c3ab0a7f46674ba298caab2e8a125be539e4 (patch) | |
tree | de357ed5d9b3312fea4bbc12075b677511669f69 /office/dictd/config/rc.dictd | |
parent | 139aca38935fdb1c36ae37d104ecf5e4348d605e (diff) |
office/dictd: Added to 13.0 repository
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 0000000000000..047c6c0cbd0ac --- /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 |