123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #!/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
|