Release: 1.0.3 -> 1.0.4cvs
[udpgate.git] / init.d / udpgate.init
1 #! /bin/sh
2 # Startup script for udpgate
3 #
4 # chkconfig: 2345 98 02
5 # description: UDP packets gateway
6
7 # Source our configuration file for these variables.
8 PORT=9201
9 LOCATION=/usr/bin/udpgate
10 if [ -f /etc/sysconfig/udpgate ] ; then
11         . /etc/sysconfig/udpgate
12 fi
13
14 prog="udpgate"
15
16 start() {
17         echo -n $"Starting $prog: " 
18         $LOCATION --start --port=$PORT
19         RETVAL=$?
20         echo
21         return $RETVAL
22 }
23
24 stop() {
25         echo -n $"Stopping $prog: "
26         $LOCATION --stop
27         RETVAL=$?
28         echo
29         return $RETVAL
30 }
31
32 case "$1" in
33                 start)
34                         start
35                         ;;
36                 stop)
37                         stop
38                         ;;
39                 status)
40                         ;;
41                 restart)
42                         stop
43                         start
44                         ;;
45                 condrestart)
46                         stop
47                         start
48                         ;;
49                 
50                 *)
51                         echo $"Usage: $0 {start|stop|restart}"
52                         exit 1
53
54 esac
55
56 exit $RETVAL