[ create a new paste ] login | about

Link: http://codepad.org/Xx8RPDkY    [ raw code | fork ]

Plain Text, pasted on Jul 30:
cat /etc/init/network-interface.conf 
# 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.

description	"configure network device"

emits net-device-up
emits net-device-down
emits static-network-up

start on net-device-added
stop on net-device-removed INTERFACE=$INTERFACE

instance $INTERFACE
export INTERFACE

pre-start script
    if [ "$INTERFACE" = lo ]; then
	# bring this up even if /etc/network/interfaces is broken
	ifconfig lo 127.0.0.1 up || true
	initctl emit -n net-device-up \
	    IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true
    fi
    mkdir -p /run/network
    exec ifup --allow auto $INTERFACE
end script

post-stop exec ifdown --allow auto $INTERFACE



Create a new paste based on this one


Comments: