Skip to content

Commit

Permalink
Fix behavior when adding devices while running
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye committed Aug 16, 2021
1 parent 203c82b commit 63132dd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions zram-config
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ fi
case "$1" in
start)
echo "zram-config start $(date +%Y-%m-%d-%H:%M:%S)" | tee -a "$ZLOG"
rm -fv "${TMPDIR}"/zram-device-list.new >> "$ZLOG"
ZTAB_EMPTY="true"
while read -r line; do
case "$line" in
Expand Down Expand Up @@ -227,12 +226,10 @@ case "$1" in
entry="$(grep "${1}.*${5}" "${TMPDIR}"/zram-device-list)"
fi
if [[ -n $entry ]]; then
echo "Entry ${entry} already exists as a zram device, skipping recreation of device."
echo "$entry" >> "${TMPDIR}"/zram-device-list.new
echo "Entry ${entry} already exists as a zram device, skipping recreation of device." >> "$ZLOG"
continue
fi
fi
test -f "${TMPDIR}"/zram-device-list.new && mv "${TMPDIR}"/zram-device-list.new "${TMPDIR}"/zram-device-list

case "$1" in
swap)
Expand Down

0 comments on commit 63132dd

Please sign in to comment.