File: INITSCRIPT

package info (click to toggle)
dictd 1.13.1%2Bdfsg-1.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,940 kB
  • sloc: ansic: 12,523; sh: 4,435; yacc: 512; makefile: 442; cpp: 277; lex: 256; perl: 175; awk: 12
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