dma: better logic for guessing username
[dragonfly.git] / etc / rc.d / addswap
bloba44dc1e967dbf85a13b0968514793c4ebf6df655
1 #!/bin/sh
3 # Add additional swap files
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.5 2007/08/10 18:28:27 swildner Exp $
9 # PROVIDE: addswap
10 # REQUIRE: mountcritlocal
11 # BEFORE: sysctl
13 . /etc/rc.subr
15 name="addswap"
16 start_cmd="addswap_start"
17 stop_cmd=":"
19 addswap_start()
21 case ${swapfile} in
22 [Nn][Oo] | '')
25 if [ -w "${swapfile}" -a -c /dev/vn0 ]; then
26 echo "Adding ${swapfile} as additional swap"
27 vnconfig -e vn0 ${swapfile} swap
30 esac
33 load_rc_config $name
34 run_rc_command "$1"