1
# network-interface - configure network device
3
# This service causes network devices to be brought up or down as a result
4
# of hardware being added or removed, including that which isn't ordinarily
7
description "configure network device"
11
emits static-network-up
13
start on net-device-added
14
stop on net-device-removed INTERFACE=$INTERFACE
20
if [ "$INTERFACE" = lo ]; then
21
# bring this up even if /etc/network/interfaces is broken
22
ifconfig lo 127.0.0.1 up || true
23
initctl emit -n net-device-up \
24
IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true
27
if ifquery --allow hotplug -l | grep -q "^${INTERFACE}\$"; then
28
exec ifup --allow hotplug $INTERFACE
30
exec ifup --allow auto $INTERFACE
35
if ifquery --allow hotplug -l | grep -q "^${INTERFACE}\$"; then
36
exec ifdown --force --allow hotplug $INTERFACE
38
exec ifdown --force --allow auto $INTERFACE