#!/bin/bash # $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/swap,v 1.2 2005-03-15 19:07:56 niro Exp $ #%rlevels: 7:s 0:k 6:k #%start: 10 #%stop: 70 #deps #%needs: #%before: #%after: source /etc/sysconfig/rc source $rc_functions case "$1" in start) echo -e ${COLOREDSTAR}"Activating all swap files/partitions ..." swapon -a evaluate_retval update_svcstatus $1 splash svc_started "$(basename $0)" 0 ;; stop) echo -e ${COLOREDSTAR}"Deactivating all swap files/partitions ..." swapoff -a evaluate_retval update_svcstatus $1 splash svc_stopped "$(basename $0)" 0 ;; 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