+Option --enable-bundle for the fully static built single-file binary.
[udpgate.git] / init.d / udpgate.init
diff --git a/init.d/udpgate.init b/init.d/udpgate.init
new file mode 100755 (executable)
index 0000000..bb48bd6
--- /dev/null
@@ -0,0 +1,61 @@
+#! /bin/sh
+# Startup script for udpgate
+#
+# chkconfig: 2345 98 02
+# description: UDP packats gateway
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+[ -f /usr/sbin/udpgate ] || exit 0
+
+prog="udpgate"
+
+start() {
+       echo -n $"Starting $prog: " 
+       daemon udpgate --start
+       RETVAL=$?
+       echo
+       return $RETVAL
+}
+
+stop() {
+       if test "x`pidof udpgate`" != x; then
+               echo -n $"Stopping $prog: "
+               killproc udpgate
+               echo
+       fi
+       RETVAL=$?
+       return $RETVAL
+}
+
+case "$1" in
+               start)
+                       start
+                       ;;
+               
+               stop)
+                       stop
+                       ;;
+               
+               status)
+                       status udpgate
+                       ;;
+               restart)
+                       stop
+                       start
+                       ;;
+               condrestart)
+                       if test "x`pidof udpgate`" != x; then
+                               stop
+                               start
+                       fi
+                       ;;
+               
+               *)
+                       echo $"Usage: $0 {start|stop|restart|condrestart|status}"
+                       exit 1
+
+esac
+
+exit $RETVAL