Home | History | Annotate | Line # | Download | only in rc.d
swap1 revision 1.8
      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 
     12 name="swap1"
     13 start_cmd="swap1_start"
     14 stop_cmd="swap1_stop"
     15 
     16 #		Add all block-type swap devices; these might be necessary
     17 #		during disk checks.
     18 #
     19 swap1_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 #
     28 swap1_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 
     36 load_rc_config swap
     37 run_rc_command "$1"
     38