#!/bin/sh # executing a shell script given as parameter(s) as root if [ `id -u` != 0 ] ; then exec sudo gainroot <<EOF exec sh $0 $* EOF exit $? fi # own shell code from here
I don't think large swaps have a benefit. When fragmentation occurs, swapoff will take forever.