01f92bf1e43714a29c93336e45772dea8874a7c8
[udpgate.git] / init.d / udpgate.init
1 #! /bin/sh
2 # Startup script for udpgate
3 #
4 # chkconfig: 2345 98 02
5 # description: UDP packats gateway
6
7 # Source function library.
8 . /etc/rc.d/init.d/functions
9
10 # Where we are?
11 # [ -f /usr/bin/udpgate ] || exit 0
12
13 prog="udpgate"
14
15 start() {
16         echo -n $"Starting $prog: " 
17         daemon udpgate --start
18         RETVAL=$?
19         echo
20         return $RETVAL
21 }
22
23 stop() {
24         if test "x`pidof udpgate`" != x; then
25                 echo -n $"Stopping $prog: "
26                 killproc udpgate
27                 echo
28         fi
29         RETVAL=$?
30         return $RETVAL
31 }
32
33 case "$1" in
34                 start)
35                         start
36                         ;;
37                 
38                 stop)
39                         stop
40                         ;;
41                 
42                 status)
43                         status udpgate
44                         ;;
45                 restart)
46                         stop
47                         start
48                         ;;
49                 condrestart)
50                         if test "x`pidof udpgate`" != x; then
51                                 stop
52                                 start
53                         fi
54                         ;;
55                 
56                 *)
57                         echo $"Usage: $0 {start|stop|restart|condrestart|status}"
58                         exit 1
59
60 esac
61
62 exit $RETVAL