Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 2b6d57de11205d1e4ec8b18312057c35 > files > 74

initng-ifiles-0.1.5-4.fc12.i686.rpm

#!/sbin/itype
# This is a i file, used by initng parsed by install_service

# NAME: 
# DESCRIPTION: 
# WWW: 

daemon daemon/ifplugd/* {
	need = system/bootmisc;
	use = system/modules system/coldplug system/ifrename;
	stdall = /dev/null;
	respawn;
	exec daemon = /usr/sbin/ifplugd --no-daemon -i ${NAME};
}

service daemon/ifplugd {
	need = system/bootmisc;
	use = system/modules system/coldplug system/ifrename;
	#stdall = /dev/null;

	script start = {
		INTERFACES=$(/usr/bin/awk '$1~/^eth|wlan|ath|ra/ {
				gsub( /\W/, "", $1); print $1
			}' < /proc/net/dev)

		for IF in ${INTERFACES}
		do
				/sbin/ngc --quiet -u daemon/ifplugd/${IF} &
		done
		wait
	};

	script stop = {
		for DAEMON in `/sbin/ngc -s | /usr/bin/awk '/daemon/ifplugd/\w+/ { print $2 }'`
		do
			/sbin/ngc --quiet -d ${DAEMON} &
		done
		wait
	};
}