From ce2acdca061116c8f800306c4779c64e10cd7f54 Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Tue, 17 Nov 2020 11:55:43 +0100 Subject: [PATCH] Make zram amount configurable with ZRAM_SIZE Change-type: patch --- zram.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zram.sh b/zram.sh index 6a054978..088a7152 100755 --- a/zram.sh +++ b/zram.sh @@ -1,13 +1,13 @@ #!/bin/bash DEVICE=/dev/zram0 -SIZE=1G +${ZRAM_SIZE:=1G} CURRENT_SIZE=$(zramctl --raw --noheadings --output DISKSIZE $DEVICE) -if [ $CURRENT_SIZE != $SIZE ]; then +if [ $CURRENT_SIZE != $ZRAM_SIZE ]; then swapoff $DEVICE - zramctl $DEVICE --algorithm lz4 --size $SIZE + zramctl $DEVICE --algorithm lz4 --size $ZRAM_SIZE mkswap $DEVICE swapon $DEVICE fi