freebsd-dev/etc/rc.d/kernel
David E. O'Brien 01faf7789b Only symlink booted kernel directory to /boot/kernel if user has explicitly
requested it.  This is too dangerous to just do behind the admin's back.
2008-08-09 01:19:00 +00:00

29 lines
425 B
Bash
Executable File

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: kernel
# REQUIRE: mountcritremote
# KEYWORD: nojail
. /etc/rc.subr
name="kernel"
rcvar=`set_rcvar`
start_cmd="kernel_start"
stop_cmd=":"
kernel_start()
{
bootdir=$(dirname $(sysctl -n kern.bootfile))
if [ "$bootdir" != /boot/kernel ] ; then
if [ ! -e /boot/kernel -o -h /boot/kernel ] ; then
ln -hfs ${bootdir} /boot/kernel
fi
fi
}
load_rc_config $name
run_rc_command "$1"