File: netscript-2.4-upstart.netscript-interface.upstart

package info (click to toggle)
netscript-2.4 5.5.5%2Bnmu1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 480 kB
  • sloc: sh: 2,166; makefile: 86
file content (31 lines) | stat: -rw-r--r-- 877 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# network-interface - configure network device
#
# This service causes network devices to be brought up or down as a result
# of hardware being added or removed, including that which isn't ordinarily
# removable.
#
# Based on work by 
# Scott James Remnant <scott@ubuntu.com>  Tue, 15 Sep 2009 03:30:29 +0100
# copyright 2009 Canonical Limited. License GPL v2
# changes for netscript-2.4
# copyright 2011 Matthew Alexander Grant License GPL V2
# Matthew Grant <matthewgrant5@gmail.com>

description	"configure network device"

start on stopped rc RUNLEVEL=[2345] and net-device-added
stop on runlevel [2345] and net-device-removed INTERFACE=$INTERFACE

instance $INTERFACE

pre-start script
	if [ "$INTERFACE" != "lo" ]; then
		exec netscript ifup $INTERFACE
	fi
end script

post-stop script
	if [ "$INTERFACE" != "lo" ]; then
		exec netscript ifdown $INTERFACE
	fi
end script