Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if [[ ! -f /swapfile ]]; then
- echo "Building swapfile..."
- sudo dd if=/dev/zero of=/swapfile bs=128M count=$1
- sudo mkswap /swapfile
- sudo swapon /swapfile
- # Mount on reboot
- if [[ -z "$(cat /etc/fstab | grep swapfile)" ]]; then
- echo "/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab > /dev/null 2>&1
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement