1#!/bin/sh 2#
| 1#!/bin/sh 2#
|
3# $NetBSD: swap1,v 1.4 2000/05/13 08:45:09 lukem Exp $
| 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 $
|
4# 5 6# PROVIDE: localswap 7# REQUIRE: disks
| 5# 6 7# PROVIDE: localswap 8# REQUIRE: disks
|
| 9# KEYWORD: FreeBSD NetBSD shutdown
|
8 9. /etc/rc.subr 10 11name="swap1" 12
| 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
|
13# Add all block-type swap devices; these might be necessary 14# during disk checks. 15#
| 29# Add all block-type swap devices; these might be necessary 30# during disk checks. 31#
|
16start_cmd='swapctl -A -t blk'
| 32swap1_start() 33{ 34 if ! checkyesno no_swap; then 35 swapctl -A -t blk 36 fi 37}
|
17 18# Remove all block-type swap devices 19#
| 38 39# Remove all block-type swap devices 40#
|
20stop_cmd="swapctl -U -t blk"
| 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}
|
21 22load_rc_config swap 23run_rc_command "$1"
| 48 49load_rc_config swap 50run_rc_command "$1"
|