fix: Address substiutions never terminating during zram/deckswap resize

This commit is contained in:
RJ Trujillo 2023-07-14 11:59:00 -06:00
parent f5a3b6e3ba
commit 2830cfd786
2 changed files with 3 additions and 3 deletions

View File

@ -54,7 +54,7 @@ deckswap-off:
resize-deckswap:
#!/usr/bin/env bash
CONFIG='/etc/default/deckswap'
CURRENT_SIZE=$(cat "${CONFIG}" | sed 's/SWAP_SIZE=//')
CURRENT_SIZE=$(cat "${CONFIG}" | sed 's/SWAP_SIZE=//g')
echo 'Current size: '${CURRENT_SIZE}
read -p 'Enter new size (1-16) in gigabytes (1G): ' NEW_SIZE
if [ -z "${NEW_SIZE//[0-9]}" ]; then
@ -96,7 +96,7 @@ zram-off:
resize-zram:
#!/usr/bin/env bash
CONFIG='/etc/systemd/zram-generator.conf'
CURRENT_SIZE=$(cat "${CONFIG}" | sed 's/zram-size=//')
CURRENT_SIZE=$(cat "${CONFIG}" | sed 's/zram-size=//g')
echo 'Current size: '${CURRENT_SIZE}
read -p 'Enter new size (512-4096) in megabytes (1024): ' NEW_SIZE
if [ -z "${NEW_SIZE//[0-9]}" ]; then

View File

@ -57,7 +57,7 @@ zram-off:
resize-zram:
#!/usr/bin/env bash
CONFIG='/etc/systemd/zram-generator.conf'
CURRENT_SIZE=$(cat "${CONFIG}" | sed 's/zram-size=//')
CURRENT_SIZE=$(cat "${CONFIG}" | sed 's/zram-size=//g')
echo 'Current size: '${CURRENT_SIZE}
read -p 'Enter new size (512-4096) in megabytes (1024): ' NEW_SIZE
if [ -z "${NEW_SIZE//[0-9]}" ]; then