diff options
author | Harald Hoyer <harald@redhat.com> | 2010-08-03 18:14:03 +0200 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2010-08-03 18:19:30 +0200 |
commit | 93cc50fe12718a04317589cce122e864137d6b42 (patch) | |
tree | b944ac0c914055daf9a00eacb273e86db4f60f21 /rc.d/rcS.d/270-autoswap.sh | |
parent | e127d5bcfe2e0175e88e8afdd644ee05a22538a5 (diff) | |
download | initscripts-93cc50fe12718a04317589cce122e864137d6b42.tar initscripts-93cc50fe12718a04317589cce122e864137d6b42.tar.gz initscripts-93cc50fe12718a04317589cce122e864137d6b42.tar.bz2 initscripts-93cc50fe12718a04317589cce122e864137d6b42.tar.xz initscripts-93cc50fe12718a04317589cce122e864137d6b42.zip |
add systemd servicesinitscripts-9.16.0.1.systemd-1
Diffstat (limited to 'rc.d/rcS.d/270-autoswap.sh')
-rwxr-xr-x | rc.d/rcS.d/270-autoswap.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/rc.d/rcS.d/270-autoswap.sh b/rc.d/rcS.d/270-autoswap.sh new file mode 100755 index 00000000..e7ce922e --- /dev/null +++ b/rc.d/rcS.d/270-autoswap.sh @@ -0,0 +1,16 @@ +#!/bin/sh +[[ $(type -t strstr) = "function" ]] || . /etc/init.d/functions + +# Start up swapping. +if [ "$AUTOSWAP" = "yes" ]; then + curswap=$(awk '/^\/dev/ { print $1 }' /proc/swaps | while read x; do get_numeric_dev dec $x ; echo -n " "; done) + swappartitions=$(blkid -t TYPE=swap -o device) + if [ x"$swappartitions" != x ]; then + for partition in $swappartitions ; do + [ ! -e $partition ] && continue + majmin=$(get_numeric_dev dec $partition) + echo $curswap | grep -qw "$majmin" || action $"Enabling local swap partitions: " swapon $partition + done + fi +fi +: |