35 lines
613 B
Bash
Executable File
35 lines
613 B
Bash
Executable File
#!/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
|