#!/bin/bash
# auto-find the scripts, since we might want to run this as sudo.
-export WORKDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )" # obtain the script's working directory.
-export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+export THISDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )" # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )"
source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
if [[ $EUID != 0 ]]; then
if [ "$SWAP_INSTANCE" == "--help" ]; then
echo "\
+$(basename $0):
This script will add a swap partition for Linux that uses hard drive space for
swap memory. This increases the amount of available memory on RAM constrained
systems. It accepts two parameters: (1) the instance of the swap file, which
fi
/bin/dd if=/dev/zero of=/var/swap.${SWAP_INSTANCE} bs=1M count=${SWAP_SIZE}
-test_or_die "creating swap file"
+exit_on_error "creating swap file"
/bin/chmod 600 /var/swap.${SWAP_INSTANCE}
-test_or_die "setting swap file permissions"
+exit_on_error "setting swap file permissions"
/sbin/mkswap /var/swap.${SWAP_INSTANCE}
-test_or_die "formatting swap file as swap partition"
+exit_on_error "formatting swap file as swap partition"
/sbin/swapon /var/swap.${SWAP_INSTANCE}
-test_or_die "enabling new swap partition"
+exit_on_error "enabling new swap partition"
free