apolloapi-v2/backend/systemd/start_swap.sh
2021-12-14 19:35:27 -05:00

15 lines
241 B
Bash
Executable File

#!/bin/bash
DEVICE=/dev/nvme0n1p1
SWAPFILE=/media/nvme/swapfile
if [ -b "$DEVICE" ]; then
if [ ! -f "$SWAPFILE" ]; then
fallocate -l 2G $SWAPFILE
chmod 600 $SWAPFILE
mkswap $SWAPFILE
fi
swapon /media/nvme/swapfile
else
exit 0
fi