diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2014-01-17 10:40:14 -0800 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2014-01-17 10:40:14 -0800 |
commit | 0f217e3983c79593ea56824256f3504b83f20a83 (patch) | |
tree | b1c31f777834258311ba640fd0f4955e9f6ef755 /sysvinit/freebsd/cloudinit | |
parent | 98fd17c55b637f4e1d136c954567c1d9b23e6c20 (diff) | |
download | vyos-cloud-init-0f217e3983c79593ea56824256f3504b83f20a83.tar.gz vyos-cloud-init-0f217e3983c79593ea56824256f3504b83f20a83.zip |
Add freebsd rc.d/sysvinit scripts
Diffstat (limited to 'sysvinit/freebsd/cloudinit')
-rwxr-xr-x | sysvinit/freebsd/cloudinit | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sysvinit/freebsd/cloudinit b/sysvinit/freebsd/cloudinit new file mode 100755 index 00000000..86a11a6e --- /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" |