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