#!/sbin/openrc-run

description="cloud-init network stage"

# add depends for network, dns, fs etc
depend() {
  after cloud-init-local
  after net
  before cloud-config
  provide cloud-init
}

start() {
  if grep -q 'cloud-init=disabled' /proc/cmdline; then
    ewarn "$RC_SVCNAME is disabled via /proc/cmdline."
  elif test -e /etc/cloud/cloud-init.disabled; then
    ewarn "$RC_SVCNAME is disabled via cloud-init.disabled file"
  else
    ebegin "cloud-init init"
    cloud-init init
    eend $?
  fi
}
