d22761024e
Pointy hat to: matteo Submitted by: matteo Reviewed by: pjd MFC after: 3 days
35 lines
482 B
Bash
35 lines
482 B
Bash
#!/bin/sh
|
|
#
|
|
# Add additional swap files
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: addswap
|
|
# REQUIRE: mountcritlocal
|
|
# BEFORE: sysctl
|
|
# KEYWORD: nojail
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="addswap"
|
|
start_cmd="addswap_start"
|
|
stop_cmd=":"
|
|
|
|
addswap_start()
|
|
{
|
|
case ${swapfile} in
|
|
[Nn][Oo] | '')
|
|
;;
|
|
*)
|
|
if [ -w "${swapfile}" ]; then
|
|
echo "Adding ${swapfile} as additional swap"
|
|
mdev=`mdconfig -a -t vnode -f ${swapfile}` && swapon /dev/${mdev}
|
|
fi
|
|
;;
|
|
esac
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|