aboutsummaryrefslogblamecommitdiffstats
path: root/main/openrc/hostname.initd
blob: bd208749fac3e54cd81f510be9b89606066cdf70 (plain) (tree)
1
2
3
4
5
6
7
8
9
                  



                                               
                                    


         
                                      

                                       
                                             




                                 
#!/sbin/openrc-run

description="Sets the hostname of the machine."

depend() {
	keyword -prefix -lxc -docker
}

start() {
	if [ -s /etc/hostname ] ; then
		opts="-F /etc/hostname"
	else
		opts="${hostname:-localhost}"
	fi
	ebegin "Setting hostname"
	hostname $opts
	eend $?
}