OSDN Git Service

Fix no pic
[uclinux-h8/uClinux-dist.git] / user / gnugk / gk.initd.suse10
1 #! /bin/sh
2 # Copyright (c) 2005 Jan Willamowius
3
4 . /etc/rc.status
5 rc_reset
6
7 # The echo return value for success (defined in /etc/rc.config).
8 return=$rc_done
9 case "$1" in
10     start)
11         echo -n "Starting GNU Gatekeeper"
12         ## Start daemon with startproc(8). If this fails
13         ## the echo return value is set appropriate.
14
15         startproc -q /usr/local/bin/gnugk || return=$rc_failed
16
17         echo -e "$return"
18         ;;
19     stop)
20         echo -n "Shutting down GNU Gatekeeper"
21         ## Stop daemon with killproc(8) and if this fails
22         ## set echo the echo return value.
23
24         killproc -TERM /usr/local/bin/gnugk || return=$rc_failed
25
26         echo -e "$return"
27         ;;
28     restart)
29         ## If first returns OK call the second, if first or
30         ## second command fails, set echo return value.
31         $0 stop  &&  $0 start  ||  return=$rc_failed
32         ;;
33     reload)
34         $0 stop  &&  $0 start  ||  return=$rc_failed
35         ;;
36     status)
37         echo -n "Checking for GNU Gatekeeper: "
38         ## Check status with checkproc(8), if process is running
39         ## checkproc will return with exit status 0.
40
41         checkproc /usr/local/bin/gnugk && echo OK || echo No process
42         ;;
43     *)
44         echo "Usage: $0 {start|stop|status|restart|reload}"
45         exit 1
46         ;;
47 esac
48
49 # Inform the caller not only verbosely and set an exit status.
50 test "$return" = "$rc_done" || exit 1
51 exit 0