From f9621d88100d2e3ce6b0061d0789401e57c4b1e8 Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Thu, 17 Mar 2022 11:09:07 +0000 Subject: Pipe download output through `cat` so it always succeeds Pipe success is determined by the success of the last command in the pipe, and `grep` indicates failure if no lines were selected. If we don't download anything then `grep` fails, the pipe fails, and the script - due to `set -e` - then fails/aborts at that point. So pipe through `cat` last, which always succeeds. --- adu-download | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adu-download b/adu-download index 574eeae..7005592 100755 --- a/adu-download +++ b/adu-download @@ -32,7 +32,7 @@ if [ "$upgrades" -eq 0 ]; then exit 0 fi -apt-get -q -y --with-new-pkgs --download-only upgrade | grep "^Get:" +apt-get -q -y --with-new-pkgs --download-only upgrade | grep "^Get:" | cat ln -s -- "${UPDATE_TARGET}" "${UPDATE_SYMLINK}" 2>/dev/null || true -- cgit v1.2.1