summaryrefslogtreecommitdiff
path: root/sysvinit/freebsd/cloudinit
blob: c5478678bd702d19236f90d9eb429aba608e605c (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
27
28
29
30
31
32
33
34
#!/bin/sh

# PROVIDE: cloudinit
# REQUIRE: FILESYSTEMS NETWORKING cloudinitlocal
# BEFORE:  cloudconfig cloudfinal

. /etc/rc.subr

export CLOUD_CFG=/usr/local/etc/cloud/cloud.cfg

name="cloudinit"
command="/usr/local/bin/cloud-init"
start_cmd="cloudinit_start"
stop_cmd=":"
rcvar="cloudinit_enable"
start_precmd="cloudinit_override"
start_cmd="cloudinit_start"

cloudinit_override()
{
	# If there exist sysconfig/defaults variable override files use it...
	if [ -f /etc/defaults/cloud-init ]; then
		. /etc/defaults/cloud-init
	fi
}

cloudinit_start()
{
	echo -n "${command} starting"
	${command} init
}

load_rc_config $name
run_rc_command "$1"