#!/bin/bash
# Begin $rc_base/init.d/swap - Swap Control Script

# Written by Gerard Beekmans  - gerard@linuxfromscratch.org

. /etc/sysconfig/rc
. $rc_functions

case "$1" in
	start)
		echo "Activating all swap files/partitions..."
		swapon -a
		evaluate_retval
		;;

	stop)
		echo "Deactivating all swap files/partitions..."
		swapoff -a
		evaluate_retval
		;;

	restart)
		$0 stop
		sleep 1
		$0 start
		;;

	status)
		echo "Retrieving swap status..."
		echo
		swapon -s
		;;

	*)
		echo "Usage: $0 {start|stop|restart|status}"
		exit 1
		;;
esac

# End $rc_base/init.d/swap
