#!/bin/bash

if [ "$IFACE" = "lo" ] ; then
	#doesn't count - no access to the outside network
	echo groovix detected lo interface up
else
	echo groovix detected $IFACE interface up


	# this is now handled by upstart /etc/init/groovix-network-is-ready.conf which touches
	# /var/run/groovix/network-ready when static-network-up is emitted
	#mkdir -p /var/run/groovix/
	#date >> /var/run/groovix/network-ready
	#echo "IFACE=$IFACE" "LOGICAL=$LOGICAL" "ADDRFAM=$ADDRFAM" "METHOD=$METHOD" >> /var/run/groovix/network-ready
	#env >> /var/run/groovix/network-ready

	# without this, any auto interfaces in /etc/network/interfaces that don't really exist
	# cause a 90 second delay during boot waiting for all interfaces to be up
	echo "groovix emitting static-network-up since at least one interface (other than lo) is up"
	#initctl emit --no-wait static-network-up
fi
