Use vnconfig(8) instead of mdconfig(8) to enable ${swapfile},
[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.2 2003/10/18 14:17:30 hmp Exp $
7 #
8
9 # PROVIDE: addswap
10 # REQUIRE: mountcritlocal
11 # BEFORE: sysctl
12 # KEYWORD: DragonFly FreeBSD 
13
14 . /etc/rc.subr
15
16 name="addswap"
17 start_cmd="addswap_start"
18 stop_cmd=":"
19
20 addswap_start()
21 {
22         case ${swapfile} in
23         [Nn][Oo] | '')
24                 ;;
25         *)
26                 if [ -w "${swapfile}" -a -c /dev/vn0c ]; then
27                         echo "Adding ${swapfile} as additional swap"
28                         vnconfig -e vn0c ${swapfile} swap
29                 fi
30                 ;;
31         esac
32 }
33
34 load_rc_config $name
35 run_rc_command "$1"