2002-06-13 22:14:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Add additional swap files
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: addswap
|
|
|
|
# REQUIRE: mountcritlocal
|
|
|
|
# BEFORE: sysctl
|
|
|
|
# KEYWORD: FreeBSD
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="addswap"
|
|
|
|
start_cmd="addswap_start"
|
|
|
|
stop_cmd=":"
|
|
|
|
|
|
|
|
addswap_start()
|
|
|
|
{
|
|
|
|
case ${swapfile} in
|
|
|
|
[Nn][Oo] | '')
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if [ -w "${swapfile}" -a -c /dev/mdctl ]; then
|
|
|
|
echo "Adding ${swapfile} as additional swap"
|
2002-10-12 10:31:31 +00:00
|
|
|
mdev=`mdconfig -a -t vnode -f ${swapfile}` && swapon /dev/${mdev}
|
2002-06-13 22:14:37 +00:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|