aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Spragg <adam@spra.gg>2022-03-17 11:09:07 +0000
committerAdam Spragg <adam@spra.gg>2022-03-17 11:09:07 +0000
commitf9621d88100d2e3ce6b0061d0789401e57c4b1e8 (patch)
treedebfe6aea115ceba3b51ea8ece4a5620d1d4ad49
parent8ae543fa8d3fdf08bcc61dcb27cafd987344ada2 (diff)
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.
-rwxr-xr-xadu-download2
1 files changed, 1 insertions, 1 deletions
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