2577f44ae4f653164dbd109d4e3449d6b75c417f
[feisty_meow.git] / scripts / system / add_swap_mount.sh
1 #!/bin/bash
2
3 # auto-find the scripts, since we might want to run this as sudo.
4 export WORKDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"  # obtain the script's working directory.
5 source "$WORKDIR/../core/launch_feisty_meow.sh"
6
7 #hmmm: should be able to add a new swap drive if desired.
8
9 #hmmm: why all the hard-coded paths below?
10
11 /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=2048
12 test_or_die "creating swap file"
13
14 /bin/chmod 600 /var/swap.1
15 test_or_die "setting swap file permissions"
16
17 /sbin/mkswap /var/swap.1
18 test_or_die "formatting swap file as swap partition"
19
20 /sbin/swapon /var/swap.1
21 test_or_die "enabling new swap partition"
22
23 free
24