X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsystem%2Fadd_swap_mount.sh;h=dc14f84e31ac97bc4ed80c65677cf68e86003392;hb=87e48192f16d2d8f36c9a44d436b29f76dfa7bc3;hp=608ffc5c3306cef0a4f241f934a784e4f948a7c2;hpb=79052f57a253bb9c4af29708d656741f6eb7affc;p=feisty_meow.git diff --git a/scripts/system/add_swap_mount.sh b/scripts/system/add_swap_mount.sh index 608ffc5c..dc14f84e 100644 --- a/scripts/system/add_swap_mount.sh +++ b/scripts/system/add_swap_mount.sh @@ -1,8 +1,8 @@ #!/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 @@ -39,16 +39,16 @@ if [ -z "$SWAP_SIZE" ]; then 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