8 my_size=${1:-$default_size}
10 if [ "0" != "$EUID" ] && [ "0" != "$UID" ]; then
12 echo ' sudo env PATH="$PATH" vps-addswap' $my_size
16 if [ -f "/var/swapfile" ]; then
21 fallocate -l "$my_size" /var/swapfile
23 # Only allow root to read it
24 # (this is not sufficient security for sensitive data)
25 chmod 0600 /var/swapfile
31 # Cause swap to be activated on boot
32 echo '/var/swapfile none swap sw 0 0' | tee -a /etc/fstab