diff options
Diffstat (limited to 'etc/nextcloudpi-config.d/nc-swapfile.sh')
-rw-r--r-- | etc/nextcloudpi-config.d/nc-swapfile.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/etc/nextcloudpi-config.d/nc-swapfile.sh b/etc/nextcloudpi-config.d/nc-swapfile.sh index 5c794381..1e5a66bf 100644 --- a/etc/nextcloudpi-config.d/nc-swapfile.sh +++ b/etc/nextcloudpi-config.d/nc-swapfile.sh @@ -14,10 +14,16 @@ # More at https://ownyourbits.com/ # -SWAPFILE_=/var/swap +SWAPFILE_=/media/USBdrive/swap SWAPSIZE_=1024 DESCRIPTION="Move and resize your swapfile. Recommended to move to a permanent USB drive" +is_active() +{ + local DIR=$( swapon -s | sed -n 2p | awk '{ print $1 }' ) + [[ "$DIR" != "/var/swap" ]] +} + configure() { local ORIG=$( grep -oP "CONF_SWAPFILE=.*" /etc/dphys-swapfile | cut -f2 -d= ) |