#!/usr/bin/execlineb -P
# simple-netaid owns DHCP (per-iface dhcpcd -4 via ifup). A supervised
# system-wide dhcpcd -B -M races after snetaid kills it and breaks the
# next ifup. Pause when snetaid is installed (same idea as runit exit 161).

envfile /etc/s6-rc/config/dhcpcd.conf
importas -sCuD "" Args Args

ifelse { test -x /usr/sbin/snetaid } {
	foreground {
		fdmove -c 2 1
		echo "Not running dhcpcd: simple-netaid (snetaid) owns networking"
	}
	s6-pause
}

fdmove -c 2 1
exec -c dhcpcd ${Args}
