File: INITSCRIPT

package info (click to toggle)
dictd 1.10.11.dfsg-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,468 kB
  • ctags: 2,165
  • sloc: ansic: 20,428; sh: 3,823; makefile: 756; yacc: 491; perl: 410; cpp: 276; lex: 255
file content (35 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
# Example script courtesy of Jeff Blain <jblaine@linus.mitre.org>

DICTD=/where/is/your/dictd_binary

# DICTD_OPTIONS="-put -command_line -options -for -dictd -here"
DICTD_OPTIONS=""

DICTD_PID_FILE=/etc/dictd.pid

case "$1" in
'start')
    if [ -x $DICTD ]; then
        echo "dictd starting."
        $DICTD $DICTD_OPTIONS
    else
        echo "dictd.init: cannot find $DICTD or it's not executable"
    fi
    ;;
'stop')
    if [ ! -f $DICTD_PID_FILE ]; then
        exit 0
    fi
    dictdpid=`cat $DICTD_PID_FILE`
    if [ "$dictdpid" -gt 0 ]; then
        echo "Stopping the dictd server."
        kill -15 $dictdpid 2>&1 > /dev/null
    fi
    rm -f $DICTD_PID_FILE
    ;;
*)
    echo "Usage: dictd.init { start | stop }"
    ;;
esac
exit 0