File: net-hotplug.sh

package info (click to toggle)
hw-detect 1.107
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 1,496 kB
  • sloc: sh: 1,306; makefile: 98; ansic: 39
file content (23 lines) | stat: -rwxr-xr-x 403 bytes parent folder | download | duplicates (11)
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