summaryrefslogtreecommitdiff
path: root/sysvinit/freebsd/cloudconfig
blob: 01bc061e0616adc6f69946678a55a8a2e2ddc011 (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
35
#!/bin/sh

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

. /etc/rc.subr

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export CLOUD_CFG=/usr/local/etc/cloud/cloud.cfg

name="cloudconfig"
command="/usr/local/bin/cloud-init"
start_cmd="cloudconfig_start"
stop_cmd=":"
rcvar="cloudinit_enable"
start_precmd="cloudinit_override"
start_cmd="cloudconfig_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
}

cloudconfig_start()
{
	echo "${command} starting"
	${command} modules --mode config
}

load_rc_config $name
run_rc_command "$1"