File: net-hotplug.sh

package info (click to toggle)
hw-detect 1.71
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,140 kB
  • ctags: 64
  • sloc: sh: 1,153; makefile: 117; ansic: 12
file content (23 lines) | stat: -rwxr-xr-x 403 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
#
# Hook into net events so that we can record hotpluggable interfaces for
# netcfg.

log () {
	logger -t net/hw-detect.hotplug "$@"
}

if [ -z "$INTERFACE" ]; then
	log "Got net event without interface"
	exit 1
fi

case $ACTION in
    add|register)
	log "Detected hotpluggable network interface $INTERFACE"
	mkdir -p /etc/network
	echo "$INTERFACE" >>/etc/network/devhotplug
	;;
esac

exit 0