Changeset View
Changeset View
Standalone View
Standalone View
libexec/rc/rc.d/hostname
Show All 36 Lines | |||||
start_cmd="hostname_start" | start_cmd="hostname_start" | ||||
stop_cmd=":" | stop_cmd=":" | ||||
hostname_start() | hostname_start() | ||||
{ | { | ||||
# If we are not inside a jail, set the host name. | # If we are not inside a jail, set the host name. | ||||
# If we are inside a jail, set the host name if it is permitted. | # If we are inside a jail, set the host name if it is permitted. | ||||
# | # | ||||
if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then | if check_jail jailed; then | ||||
if [ `$SYSCTL_N security.jail.set_hostname_allowed` -eq 0 ]; then | if ! check_jail set_hostname_allowed; then | ||||
return | return | ||||
fi | fi | ||||
else | else | ||||
# If we're not in a jail and rc.conf doesn't specify a | # If we're not in a jail and rc.conf doesn't specify a | ||||
# hostname, see if we can get one from kenv. | # hostname, see if we can get one from kenv. | ||||
# | # | ||||
if [ -z "${hostname}" -a \ | if [ -z "${hostname}" -a \ | ||||
-n "`/bin/kenv dhcp.host-name 2> /dev/null`" ]; then | -n "`/bin/kenv dhcp.host-name 2> /dev/null`" ]; then | ||||
Show All 30 Lines |