From abf37fab5b67ecd3e4c1c2981868cadca170c04f Mon Sep 17 00:00:00 2001 From: Fabian Weik Date: Sun, 23 Jul 2023 10:47:59 +0200 Subject: [PATCH] skip compression if lz4 not installed on tablet #12 --- reSnap.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/reSnap.sh b/reSnap.sh index 15d048d..8f4b774 100755 --- a/reSnap.sh +++ b/reSnap.sh @@ -145,25 +145,27 @@ else fi +# don't remove, related to this pr +# https://github.com/cloudsftp/reSnap/pull/6 +FFMPEG_ABS="$(command -v ffmpeg)" +LZ4_ABS="$(command -v lz4)" +decompress="${LZ4_ABS} -d" + # compression commands if ssh_cmd "[ -f /opt/bin/lz4 ]"; then compress="/opt/bin/lz4" elif ssh_cmd "[ -f ~/lz4 ]"; then # backwards compatibility compress="\$HOME/lz4" else - echo "lz4 not found on $rm_version. Please refer to the README" - exit 2 + echo "WARNING: lz4 not found on $rm_version. Please refer to the README" + compress="tee" + decompress="tee" fi -# don't remove, related to this pr -# https://github.com/cloudsftp/reSnap/pull/6 -FFMPEG_ABS="$(command -v ffmpeg)" -LZ4_ABS="$(command -v lz4)" - # read and compress the data on the reMarkable # decompress and decode the data on this machine ssh_cmd "$head_fb0 | $compress" | - "${LZ4_ABS}" -d | + $decompress | "${FFMPEG_ABS}" -y \ -f rawvideo \ -pixel_format $pixel_format \