+Option --enable-bundle for the fully static built single-file binary.
[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 [ -f /usr/sbin/udpgate ] || exit 0
11
12 prog="udpgate"
13
14 start() {
15         echo -n $"Starting $prog: " 
16         daemon udpgate --start
17         RETVAL=$?
18         echo
19         return $RETVAL
20 }
21
22 stop() {
23         if test "x`pidof udpgate`" != x; then
24                 echo -n $"Stopping $prog: "
25                 killproc udpgate
26                 echo
27         fi
28         RETVAL=$?
29         return $RETVAL
30 }
31
32 case "$1" in
33                 start)
34                         start
35                         ;;
36                 
37                 stop)
38                         stop
39                         ;;
40                 
41                 status)
42                         status udpgate
43                         ;;
44                 restart)
45                         stop
46                         start
47                         ;;
48                 condrestart)
49                         if test "x`pidof udpgate`" != x; then
50                                 stop
51                                 start
52                         fi
53                         ;;
54                 
55                 *)
56                         echo $"Usage: $0 {start|stop|restart|condrestart|status}"
57                         exit 1
58
59 esac
60
61 exit $RETVAL