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