Changeset View
Changeset View
Standalone View
Standalone View
head/net/dhcp6/files/dhcp6c.in
Show All 36 Lines | |||||
: ${dhcp6c_enable="NO"} | : ${dhcp6c_enable="NO"} | ||||
: ${dhcp6c_config="%%PREFIX%%/etc/${name}.conf"} | : ${dhcp6c_config="%%PREFIX%%/etc/${name}.conf"} | ||||
: ${dhcp6c_dhcp6cctlkey="%%PREFIX%%/etc/dhcp6cctlkey"} | : ${dhcp6c_dhcp6cctlkey="%%PREFIX%%/etc/dhcp6cctlkey"} | ||||
: ${dhcp6c_pidfile="/var/run/${name}.pid"} | : ${dhcp6c_pidfile="/var/run/${name}.pid"} | ||||
required_files="${dhcp6c_config}" | required_files="${dhcp6c_config}" | ||||
pidfile="${dhcp6c_pidfile}" | pidfile="${dhcp6c_pidfile}" | ||||
command_args="-c ${dhcp6c_config} -p ${dhcp6c_pidfile} ${dhcp6c_flags} ${dhcp6c_interfaces}" | command_args="-c ${dhcp6c_config} -p ${dhcp6c_pidfile} ${dhcp6c_interfaces}" | ||||
dhcp6c_precmd() | dhcp6c_precmd() | ||||
{ | { | ||||
if [ -z ${dhcp6c_interfaces} ]; then | if [ -z ${dhcp6c_interfaces} ]; then | ||||
warn "dhcp6c_interfaces is not set." | warn "dhcp6c_interfaces is not set." | ||||
return 1 | return 1 | ||||
fi | fi | ||||
if [ ! -s ${dhcp6c_dhcp6cctlkey} ]; then | if [ ! -s ${dhcp6c_dhcp6cctlkey} ]; then | ||||
echo "Creating ${dhcp6c_dhcp6cctlkey}" | echo "Creating ${dhcp6c_dhcp6cctlkey}" | ||||
(umask 077 ; openssl rand -base64 48 > ${dhcp6c_dhcp6cctlkey}) | (umask 077 ; openssl rand -base64 48 > ${dhcp6c_dhcp6cctlkey}) | ||||
fi | fi | ||||
} | } | ||||
run_rc_command "$1" | run_rc_command "$1" |