Codebase list hw-detect / af79be58-2119-4f5a-b248-1dbef50ad912/main net-hotplug.sh
af79be58-2119-4f5a-b248-1dbef50ad912/main

Tree @af79be58-2119-4f5a-b248-1dbef50ad912/main (Download .tar.gz)

net-hotplug.sh @af79be58-2119-4f5a-b248-1dbef50ad912/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