From 0f217e3983c79593ea56824256f3504b83f20a83 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Fri, 17 Jan 2014 10:40:14 -0800 Subject: Add freebsd rc.d/sysvinit scripts --- sysvinit/freebsd/cloudfinal | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 sysvinit/freebsd/cloudfinal (limited to 'sysvinit/freebsd/cloudfinal') diff --git a/sysvinit/freebsd/cloudfinal b/sysvinit/freebsd/cloudfinal new file mode 100755 index 00000000..7f0cf599 --- /dev/null +++ b/sysvinit/freebsd/cloudfinal @@ -0,0 +1,35 @@ +#!/bin/sh + +# PROVIDE: cloudfinal +# REQUIRE: LOGIN cloudinit cloudconfig cloudinitlocal +# REQUIRE: cron mail sshd swaplate + + +. /etc/rc.subr + +name="cloudfinal" +command="/usr/bin/cloud_init" +start_cmd="cloudfinal_start" +stop_cmd=":" +rcvar="cloudinit_enable" +start_precmd="cloudinit_override" +start_cmd="cloudfinal_start" + +: ${cloud-init_config}:="/etc/cloud/cloud.cfg"} + + +cloudinit_override() +{ + # If there exist sysconfig/default variable override files use it... + if [ -f /etc/default/cloud-init ]; then + . /etc/default/cloud-init + fi +} + +cloudfinal_start() { + echo -n "${command} starting" + ${command} ${cloudinit_config} modules --mode final +} + +load_rc_config $name +run_rc_command "$1" -- cgit v1.2.3