summaryrefslogtreecommitdiff
path: root/sysutils/xenstoretools/files/xendomname.sh
blob: 6f37a9414a804456e0219ac712b5d870411497cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!@RCD_SCRIPTS_SHELL@

# PROVIDE: xendomname
# REQUIRE: network mountcritlocal
# BEFORE:  dhcpcd
#
# Sets the hostname to the xen domain name
# (dhcpcd can pick it up and send it to the DHCP server.)
#

$_rc_subr_loaded . /etc/rc.subr

name=xendomname
rcvar=$name
start_cmd="xendomname_start"

xendomname_start()
{
	mount /kern || true
	dname="`@PREFIX@/bin/xenstore-read name`"
	echo "Setting hostname to xen domain name: $dname"
	hostname "$dname"
}

load_rc_config $name
run_rc_command "$1"