aports/main/openrc/hostname.initd
Natanael Copa b6b6dcd2e8 main/openrc: fix hostname script
we should not override hostname set in /etc/conf.d/hostname

ref #9737
2018-12-07 14:44:18 +00:00

19 lines
269 B
Plaintext

#!/sbin/openrc-run
description="Sets the hostname of the machine."
depend() {
keyword -prefix -lxc
}
start() {
if [ -s /etc/hostname ] ; then
opts="-F /etc/hostname"
else
opts="${hostname:-localhost}"
fi
ebegin "Setting hostname"
hostname $opts
eend $?
}