File: dsidentify.tmpl

package info (click to toggle)
cloud-init 25.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,412 kB
  • sloc: python: 135,894; sh: 3,883; makefile: 141; javascript: 30; xml: 22
file content (38 lines) | stat: -rwxr-xr-x 987 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## template:jinja
#!/bin/sh

# PROVIDE: dsidentify
# REQUIRE: cleanvar
# BEFORE:  cloudinitlocal

. /etc/rc.subr

PATH="{{ prefix }}/sbin:{{ prefix }}/bin:/usr/sbin:/usr/bin:/sbin:/bin"

name="dsidentify"
command="{{ prefix }}/lib/cloud-init/ds-identify"
start_cmd="dsidentify_start"
stop_cmd=":"
rcvar="cloudinit_enable"

dsidentify_start()
{
    if checkyesno cloudinit_dsidentify_enable; then
        echo "${command} starting"
        if kenv -q kernel_options | grep -q 'cloud-init=disabled'; then
            warn "cloud-init is disabled via kernel_options."
        elif test -e {{ prefix }}/etc/cloud-init.disabled; then
            warn "cloud-init is disabled via cloud-init.disabled file."
        else
            ${command}
        fi
    fi
}

load_rc_config 'cloudinit'

: ${cloudinit_enable="NO"}
: ${cloudinit_dsidentify_enable="YES"}
: ${dsidentify_env="PATH_DI_CONFIG={{ prefix }}/etc/cloud/ds-identify.cfg PATH_ETC_CLOUD={{ prefix }}/etc/cloud"}

run_rc_command "$1"