initscripts/etc/rc.d/init.d/swap

35 lines
613 B
Plaintext
Raw Normal View History

2011-04-26 12:26:24 +02:00
#!/bin/sh
# swap - swap control script
# Written by Gerard Beekmans <gerard@linuxfromscratch.org>
. /etc/sysconfig/rc
. $rc_functions
case "$1" in
start)
echo -n "Activating all swap files/partitions: "
swapon -a
evaluate_retval
echo
;;
stop)
echo -n "Deactivating all swap files/partitions: "
swapoff -a
evaluate_retval
echo
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
echo -n "Retrieving swap status..."
echo
swapon -s
;;
*) echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac