Codebase list hw-detect / 69fcced1-479e-41fb-86fc-2d9d094f3785/main net-hotplug.sh
69fcced1-479e-41fb-86fc-2d9d094f3785/main

Tree @69fcced1-479e-41fb-86fc-2d9d094f3785/main (Download .tar.gz)

net-hotplug.sh @69fcced1-479e-41fb-86fc-2d9d094f3785/mainraw · history · blame

#!/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