Sync usage with man page.
[netbsd-mini2440.git] / etc / rc.d / swap1
blob28ec63ab36b5f6632f5962754d4cda1dae5eb808
1 #!/bin/sh
3 # $NetBSD: swap1,v 1.10 2009/04/21 16:08:57 joerg Exp $
6 # PROVIDE: localswap
7 # REQUIRE: DISKS root
8 # KEYWORD: shutdown
10 $_rc_subr_loaded . /etc/rc.subr
12 name="swap1"
13 start_cmd="swap1_start"
14 stop_cmd="swap1_stop"
16 # Add all block-type swap devices; these might be necessary
17 # during disk checks.
19 swap1_start()
21 # Treat exit status 2 from swapctl(8) as successful; it means
22 # "no error, but no suitable swap devices were configured".
24 if ! checkyesno no_swap; then
25 swapctl -A -t blk || [ $? = 2 ]
29 # Remove all block-type swap devices
31 swap1_stop()
33 if checkyesno swapoff || [ -n "$rc_force" ]; then
34 echo "Removing block-type swap devices"
35 swapctl -U -t blk || [ $? = 2 ]
39 load_rc_config swap
40 run_rc_command "$1"