Handle the case when the admin forgot to set $hostname,
which can happen in new installations: advise to set the variable and refer to rc.conf(5).
This commit is contained in:
parent
31a9460383
commit
aad85353cc
@ -58,7 +58,16 @@ hostname_start()
|
||||
fi
|
||||
fi
|
||||
|
||||
/bin/hostname ${hostname}
|
||||
# Have we got a hostname yet?
|
||||
#
|
||||
if [ -z "${hostname}" ]; then
|
||||
warn "\$hostname is not set -- see ${rcvar_manpage}."
|
||||
return
|
||||
fi
|
||||
|
||||
# All right, it is safe to invoke hostname(1) now.
|
||||
#
|
||||
/bin/hostname "${hostname}"
|
||||
echo "Setting hostname: `hostname`."
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user