freebsd-dev/etc/rc.d/addswap
Hiroki Sato 5d595cb88e Integrate rc.d/network_ipv6 into rc.d/netif:
- Add rc.d/stf and rc.d/faith for stf(4) and faith(4).
- Remove rc.d/auto_linklocal and rc.d/network_ipv6.
- Move rc.d/sysctl to just before FILESYSTEMS because rc.d/netif
  depends on some sysctl variables.

Reviewed by:	brooks
MFC after:	3 days
2009-09-12 22:13:41 +00:00

34 lines
462 B
Bash
Executable File

#!/bin/sh
#
# Add additional swap files
#
# $FreeBSD$
#
# PROVIDE: addswap
# REQUIRE: FILESYSTEMS
# 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"