summaryrefslogtreecommitdiff
path: root/system/openrc/hostname.initd
blob: c1580db084d2516c2c84ee2cdd89f41f70fa8df8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/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="localhost"
	fi
	ebegin "Setting hostname"
	hostname $opts
	eend $?
}