add compatibility with swapfile directory (for btrfs)

This commit is contained in:
PowerUser64 2022-05-11 03:37:23 -07:00
parent e89ae1a694
commit f511cc73ab
2 changed files with 19 additions and 6 deletions

View file

@ -1,6 +1,13 @@
#!/bin/bash
# Deletes the swapfile created by mkswp()
sudo swapoff -v /swapfile
sudo rm /swapfile
if [ -d /swap ]; then
SWAPFILE=/swap/swapfile
else
SWAPFILE=/swapfile
fi
sudo swapoff -v "$SWAPFILE"
sudo rm "$SWAPFILE"