542352c7f9ab05bb48fb15e596336a8cf9b699e6
[dragonfly.git] / etc / rc.d / addswap
1 #!/bin/sh
2 #
3 # Add additional swap files
4 #
5 # $FreeBSD: src/etc/rc.d/addswap,v 1.2 2002/10/12 10:31:31 schweikh Exp $
6 # $DragonFly: src/etc/rc.d/addswap,v 1.4 2005/11/19 21:47:32 swildner Exp $
7 #
8
9 # PROVIDE: addswap
10 # REQUIRE: mountcritlocal
11 # BEFORE: sysctl
12
13 . /etc/rc.subr
14
15 name="addswap"
16 start_cmd="addswap_start"
17 stop_cmd=":"
18
19 addswap_start()
20 {
21         case ${swapfile} in
22         [Nn][Oo] | '')
23                 ;;
24         *)
25                 if [ -w "${swapfile}" -a -c /dev/vn0c ]; then
26                         echo "Adding ${swapfile} as additional swap"
27                         vnconfig -e vn0c ${swapfile} swap
28                 fi
29                 ;;
30         esac
31 }
32
33 load_rc_config $name
34 run_rc_command "$1"