440ee7e0ef
Bump version to 1.1 for the change.
35 lines
803 B
Bash
35 lines
803 B
Bash
#!/bin/sh
|
|
|
|
# KEYWORD: firstboot
|
|
# PROVIDE: firstboot_freebsd_update
|
|
# REQUIRE: syslogd NETWORKING
|
|
# BEFORE: LOGIN
|
|
|
|
# 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_freebsd_update_enable="YES"
|
|
|
|
. /etc/rc.subr
|
|
|
|
: ${firstboot_freebsd_update_enable:="NO"}
|
|
|
|
name="firstboot_freebsd_update"
|
|
rcvar=firstboot_freebsd_update_enable
|
|
start_cmd="firstboot_freebsd_update_run | logger -s -t 'freebsd-update'"
|
|
stop_cmd=":"
|
|
|
|
firstboot_freebsd_update_run()
|
|
{
|
|
|
|
freebsd-update fetch
|
|
if [ -e /var/db/freebsd-update/`echo / | sha256`-install ]; then
|
|
freebsd-update install
|
|
echo "Requesting reboot after installing updates."
|
|
touch ${firstboot_sentinel}-reboot
|
|
fi
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|
|
|