freebsd-dev/etc/rc.d/addswap
Pawel Jakub Dawidek bd57d5b0f5 Mark scripts as not usable inside a jail by adding keyword 'nojail'.
Some suggestions from:	rwatson, Ruben de Groot <mail25@bzerk.org>
2004-03-08 12:25:05 +00:00

35 lines
507 B
Bash

#!/bin/sh
#
# Add additional swap files
#
# $FreeBSD$
#
# PROVIDE: addswap
# REQUIRE: mountcritlocal
# BEFORE: sysctl
# KEYWORD: FreeBSD nojail
. /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"
mdev=`mdconfig -a -t vnode -f ${swapfile}` && swapon /dev/${mdev}
fi
;;
esac
}
load_rc_config $name
run_rc_command "$1"