swap revision 124622
1#!/bin/sh
2#
3# $NetBSD: swap1,v 1.8 2002/03/24 15:52:41 lukem Exp $
4# $FreeBSD: head/etc/rc.d/swap1 124622 2004-01-17 10:59:43Z mtm $
5#
6
7# PROVIDE: localswap
8# REQUIRE: disks
9# KEYWORD: FreeBSD shutdown
10
11. /etc/rc.subr
12
13name="swap1"
14start_cmd='swapon -a'
15stop_cmd=':'
16
17#		Add all block-type swap devices; these might be necessary
18#		during disk checks.
19#
20swap1_start()
21{
22	if ! checkyesno no_swap; then
23		swapctl -A -t blk
24	fi
25}
26
27#		Remove all block-type swap devices
28#
29swap1_stop()
30{
31	if checkyesno swapoff || [ -n "$rc_force" ]; then
32		echo "Removing block-type swap devices"
33		swapctl -U -t blk
34	fi
35}
36
37load_rc_config swap
38run_rc_command "$1"
39