vp-build/srcpkgs/66-boot/files/dhclient/dhclient@

41 lines
743 B
Plaintext

[main]
@type = classic
@description = "dhclient on @I"
@user = ( root )
@options = ( log env )
[start]
@build = auto
@execute = (
foreground
{
if -nt { s6-test -d ${dir_run} }
s6-mkdir -p -m 0755 ${dir_run}
}
foreground
{
if
{
if -nt { s6-test -d ${conf_dir} }
s6-mkdir -p -m 0755 ${conf_dir}
}
s6-touch ${conf_dir}/${conf_file}
}
execl-cmdline -s { dhclient ${cmd_args} -cf ${conf_dir}/${conf_file} -pf ${dir_run}/${pid_name} @I }
)
[stop]
@build = auto
@execute = (
if { execl-cmdline -s { dhclient ${cmd_args_stop} } }
s6-rmrf ${pid_file}
)
[environment]
cmd_args=!-d -v
cmd_args_stop=!-r
conf_dir=!/etc/dhcp
conf_file=!dhclient-@I.conf
dir_run=!/run/dhclient-@I
pid_name=!dhclient.pid