#!/bin/sh

# KEYWORD: firstboot
# PROVIDE: firstboot_cloudsetup
# BEFORE: NETWORKING

# Add the following lines to /etc/rc.conf.local or /etc/rc.conf (in the disk
# image, since this only runs on the first boot) to enable this:
#
# firstboot_cloudsetup_enable="YES"

. /etc/rc.subr

: ${firstboot_cloudsetup_enable:="NO"}

name="firstboot_cloudsetup"
rcvar=firstboot_cloudsetup_enable
start_cmd="firstboot_cloudsetup_run"
stop_cmd=":"

firstboot_cloudsetup_run()
{
	/usr/local/sbin/cloudsetup user --install
	/usr/local/sbin/cloudsetup network --install
}

load_rc_config $name
run_rc_command "$1"
