diff options
author | Joshua Harlow <harlowja@gmail.com> | 2014-01-23 16:37:42 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-01-23 16:37:42 -0500 |
commit | b7eae0adee173208f0b98b6ad14d59771145215c (patch) | |
tree | a8144efef285bbfb0b369e7138c7a215924ec888 | |
parent | 8e035f857a06adb5493bbcd35bd427cf2a9e813b (diff) | |
parent | d9dc891c243d5bb7e876c32c76f93becb133f915 (diff) | |
download | vyos-cloud-init-b7eae0adee173208f0b98b6ad14d59771145215c.tar.gz vyos-cloud-init-b7eae0adee173208f0b98b6ad14d59771145215c.zip |
Add freebsd sysvinit scripts
-rwxr-xr-x | sysvinit/freebsd/cloudconfig | 34 | ||||
-rwxr-xr-x | sysvinit/freebsd/cloudfinal | 34 | ||||
-rwxr-xr-x | sysvinit/freebsd/cloudinit | 34 | ||||
-rwxr-xr-x | sysvinit/freebsd/cloudinitlocal | 34 |
4 files changed, 136 insertions, 0 deletions
diff --git a/sysvinit/freebsd/cloudconfig b/sysvinit/freebsd/cloudconfig new file mode 100755 index 00000000..15d7ab95 --- /dev/null +++ b/sysvinit/freebsd/cloudconfig @@ -0,0 +1,34 @@ +#!/bin/sh + +# PROVIDE: cloudconfig +# REQUIRE: cloudinit cloudinitlocal +# BEFORE: cloudfinal + +. /etc/rc.subr + +name="cloudconfig" +command="/usr/bin/cloud-init" +start_cmd="cloudconfig_start" +stop_cmd=":" +rcvar="cloudinit_enable" +start_precmd="cloudinit_override" +start_cmd="cloudconfig_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 +} + +cloudconfig_start() +{ + echo "${command} starting" + ${command} ${cloudinit_config} modules --mode config +} + +load_rc_config $name +run_rc_command "$1" diff --git a/sysvinit/freebsd/cloudfinal b/sysvinit/freebsd/cloudfinal new file mode 100755 index 00000000..49945ecd --- /dev/null +++ b/sysvinit/freebsd/cloudfinal @@ -0,0 +1,34 @@ +#!/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" + +: ${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 +} + +cloudfinal_start() +{ + echo -n "${command} starting" + ${command} ${cloudinit_config} modules --mode final +} + +load_rc_config $name +run_rc_command "$1" 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" diff --git a/sysvinit/freebsd/cloudinitlocal b/sysvinit/freebsd/cloudinitlocal new file mode 100755 index 00000000..b55705c0 --- /dev/null +++ b/sysvinit/freebsd/cloudinitlocal @@ -0,0 +1,34 @@ +#!/bin/sh + +# PROVIDE: cloudinitlocal +# REQUIRE: mountcritlocal +# BEFORE: NETWORKING FILESYSTEMS cloudinit cloudconfig cloudfinal + +. /etc/rc.subr + +name="cloudinitlocal" +command="/usr/bin/cloud-init" +start_cmd="cloudlocal_start" +stop_cmd=":" +rcvar="cloudinit_enable" +start_precmd="cloudinit_override" +start_cmd="cloudlocal_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 +} + +cloudlocal_start() +{ + echo -n "${command} starting" + ${command} ${cloudinit_config} init --local +} + +load_rc_config $name +run_rc_command "$1" |