2006-11-20 18:06:44 +01:00
|
|
|
# !!! Don't like it that I have to pass the kernel here.
|
2006-11-20 18:28:08 +01:00
|
|
|
{nettools, kernel, module_init_tools}:
|
2006-11-20 18:06:44 +01:00
|
|
|
|
|
|
|
{
|
|
|
|
name = "network-interfaces";
|
|
|
|
|
|
|
|
job = "
|
2006-11-20 18:28:08 +01:00
|
|
|
start on hardware-scan
|
2006-11-20 18:06:44 +01:00
|
|
|
stop on shutdown
|
|
|
|
|
|
|
|
start script
|
|
|
|
export MODULE_DIR=${kernel}/lib/modules/
|
|
|
|
|
2006-11-20 18:28:08 +01:00
|
|
|
${module_init_tools}/sbin/modprobe af_packet
|
2006-11-24 17:31:01 +01:00
|
|
|
|
2006-11-20 18:06:44 +01:00
|
|
|
for i in $(cd /sys/class/net && ls -d *); do
|
|
|
|
echo \"Bringing up network device $i...\"
|
|
|
|
${nettools}/sbin/ifconfig $i up || true
|
|
|
|
done
|
2006-11-24 17:31:01 +01:00
|
|
|
|
2006-11-20 18:06:44 +01:00
|
|
|
end script
|
|
|
|
|
|
|
|
# Hack: Upstart doesn't yet support what we want: a service that
|
|
|
|
# doesn't have a running process associated with it.
|
|
|
|
respawn sleep 10000
|
|
|
|
|
|
|
|
stop script
|
|
|
|
for i in $(cd /sys/class/net && ls -d *); do
|
2006-11-24 17:31:01 +01:00
|
|
|
echo \"Taking down network device $i...\"
|
2006-11-20 18:06:44 +01:00
|
|
|
${nettools}/sbin/ifconfig $i down || true
|
|
|
|
done
|
|
|
|
end script
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
}
|