Browse Source

Added Debian init-script

Dmitry Yu Okunev 7 years ago
parent
commit
d738de4cc9
1 changed files with 44 additions and 0 deletions
  1. 44 0
      debian/ipw

+ 44 - 0
debian/ipw

@@ -0,0 +1,44 @@
+#! /bin/sh
+#
+# ipw          network configuration utility 
+#
+#              Written by Dmitry Yu Okunev <dyokunev@ut.mephi.ru>
+#
+### BEGIN INIT INFO
+# Provides:          ipw
+# Required-Start:    mountkernfs $local_fs urandom networking
+# Required-Stop:     $local_fs
+# Should-Start       lxc
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Starts network
+# Description:       Starts network
+### END INIT INFO
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
+NAME=ipw
+#includes lsb functions 
+. /lib/lsb/init-functions
+
+case "$1" in
+	start)
+		log_action_begin_msg "Applying $NAME configuration..."
+		ipw fix
+		log_end_msg 0
+		;;
+	restart|reload|force-reload)
+		log_action_begin_msg "Applying $NAME configuration..."
+		ipw fix
+		log_end_msg 0
+		;;
+	stop)
+		log_action_begin_msg "Running $NAME down"
+		ipw down
+		log_end_msg 0
+		;;
+	*)
+		echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2
+		exit 1
+		;;
+esac
+
+exit 0