Shell script `default/swap'

Install a swap space of 256MB if you system has nothing.

SWAP_CHECK=$(sudo swapon --show) if [ -z "$SWAP_CHECK" ] ; then echo 'Install swap space of 256MB.' sudo fallocate -l 256M /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile sudo cp /etc/fstab /etc/fstab.bak echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab > /dev/null echo 'Done' else echo 'Your system already had swap space.' fi