#!/bin/bash

# sourcing our current rc.conf requires this to be a bash script
. /usr/lib/rc/functions

case "$1" in
    start)
        stat_busy "Activating swap"
        swapon -a || stat_die swap
        add_daemon swap
        stat_done swap
        ;;
    stop)
        stat_busy "Deactivating swap"
        swapoff -a || stat_die swap
        rm_daemon swap
        stat_done swap
        ;;
    *)
        echo "usage: $0 {start|stop}"
        exit 1
        ;;
esac
