[Main]
Type = oneshot
Version = 0.1.1
Description = "resolvconf oneshot"
User = ( root )
Depends = ( populate-run mount-rw )
Options = ( !log )

[Start]
Execute = (
	ifelse -n { test -x /usr/sbin/resolvconf } { exit 0 }
	foreground { rm -f /run/resolvconf/resolv.conf /run/resolvconf/enable-updates /run/resolvconf/postponed-update }
	foreground { rm -rf /run/resolvconf/interface }
	foreground { install -d -m 755 /run/resolvconf/interface }
	foreground { touch /run/resolvconf/postponed-update }
	exec /usr/sbin/resolvconf --enable-updates
)

[Stop]
Execute = (
	ifelse -n { test -x /usr/sbin/resolvconf } { exit 0 }
	foreground {
		backtick -in _ {
			redirfd -w 1 /dev/null
			redirfd -w 2 /dev/null
			/usr/sbin/resolvconf --disable-updates
		}
	}
	exit 0
)
