~harlowja/cloud-init/ds-openstack

« back to all changes in this revision

Viewing changes to sysvinit/freebsd/cloudinitlocal

  • Committer: Joshua Harlow
  • Date: 2014-02-07 23:14:26 UTC
  • mfrom: (913.1.22 trunk)
  • Revision ID: harlowja@yahoo-inc.com-20140207231426-2natgf64l4o055du
Remerged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# PROVIDE: cloudinitlocal
 
4
# REQUIRE: mountcritlocal 
 
5
# BEFORE:  NETWORKING FILESYSTEMS cloudinit cloudconfig cloudfinal
 
6
 
 
7
. /etc/rc.subr
 
8
 
 
9
name="cloudinitlocal"
 
10
command="/usr/bin/cloud-init"
 
11
start_cmd="cloudlocal_start"
 
12
stop_cmd=":"
 
13
rcvar="cloudinit_enable"
 
14
start_precmd="cloudinit_override"
 
15
start_cmd="cloudlocal_start"
 
16
 
 
17
: ${cloudinit_config:="/etc/cloud/cloud.cfg"}
 
18
 
 
19
cloudinit_override()
 
20
{
 
21
        # If there exist sysconfig/default variable override files use it...
 
22
        if [ -f /etc/default/cloud-init ]; then
 
23
                . /etc/default/cloud-init
 
24
        fi
 
25
}
 
26
 
 
27
cloudlocal_start()
 
28
{
 
29
        echo -n "${command} starting"
 
30
        ${command} ${cloudinit_config} init --local
 
31
}
 
32
 
 
33
load_rc_config $name
 
34
run_rc_command "$1"