Codebase list hw-detect / 7e16a2d4-ffa4-4507-80e8-716b07123ca5/main net-hotplug.sh
7e16a2d4-ffa4-4507-80e8-716b07123ca5/main

Tree @7e16a2d4-ffa4-4507-80e8-716b07123ca5/main (Download .tar.gz)

net-hotplug.sh @7e16a2d4-ffa4-4507-80e8-716b07123ca5/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