summaryrefslogtreecommitdiff
path: root/sysvinit/freebsd/cloudinit
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2014-02-07 15:14:26 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2014-02-07 15:14:26 -0800
commit2983a26ecf9716dc957ec4bacf15544072774190 (patch)
treea7e074c21789ebc553713b3fd591fd9bbe4a9684 /sysvinit/freebsd/cloudinit
parent810df2c55c108e7e4064263e508d9786d8b1dc8e (diff)
parent3cfe9b3d8958b1a4e450d5ff31d805c424945027 (diff)
downloadvyos-cloud-init-2983a26ecf9716dc957ec4bacf15544072774190.tar.gz
vyos-cloud-init-2983a26ecf9716dc957ec4bacf15544072774190.zip
Remerged with trunk
Diffstat (limited to 'sysvinit/freebsd/cloudinit')
-rwxr-xr-xsysvinit/freebsd/cloudinit34
1 files changed, 34 insertions, 0 deletions
diff --git a/sysvinit/freebsd/cloudinit b/sysvinit/freebsd/cloudinit
new file mode 100755
index 00000000..8d5ff10e
--- /dev/null
+++ b/sysvinit/freebsd/cloudinit
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# PROVIDE: cloudinit
+# REQUIRE: FILESYSTEMS NETWORKING cloudinitlocal
+# BEFORE: cloudconfig cloudfinal
+
+. /etc/rc.subr
+
+name="cloudinit"
+command="/usr/bin/cloud_init"
+start_cmd="cloudinit_start"
+stop_cmd=":"
+rcvar="cloudinit_enable"
+start_precmd="cloudinit_override"
+start_cmd="cloudinit_start"
+
+: ${cloudinit_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
+}
+
+cloudinit_start()
+{
+ echo -n "${command} starting"
+ ${command} ${cloudinit_config} init
+}
+
+load_rc_config $name
+run_rc_command "$1"