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