From 7fd71bfe2013f58b3ba2be2e0d59775b3d515dd8 Mon Sep 17 00:00:00 2001 From: Poikilos <7557867+poikilos@users.noreply.github.com> Date: Thu, 29 Jan 2026 20:37:39 -0500 Subject: [PATCH] Correctly check return code of rsync. --- utilities/pull-lmk | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/utilities/pull-lmk b/utilities/pull-lmk index 51278ab..3f09dd9 100755 --- a/utilities/pull-lmk +++ b/utilities/pull-lmk @@ -10,6 +10,7 @@ if [ -d "/opt/rjkbin" ]; then echo "Error: This should *not* be run on the server that has the master copy." exit 1 fi +code= if [ "x$OFFLINE" = "xfalse" ]; then rsync -rtlv --delete mtio:/opt/minebest/ /opt/minebest \ --include "assemble/***" \ @@ -19,6 +20,15 @@ if [ "x$OFFLINE" = "xfalse" ]; then --include "mtkit.txt" \ --exclude "*" \ ; + code=$? + + if [ $code -eq 0 ]; then + echo "[pull-lmk] * downloading /opt/minebest...OK" + else + echo "[pull-lmk] * downloading /opt/minebest...FAILED" + exit $code + fi + fi # l: copy symlinks as symlinks # L: transform symlink into referent file/dir @@ -44,13 +54,6 @@ if [ -L /opt/minebest/mtworlds ]; then rm /opt/minebest/mtworlds; fi # the install source when using the maintainer rsync copy as the # install source) -code=$? -if [ $code -eq 0 ]; then - echo "[pull-lmk] * downloading /opt/minebest...OK" -else - echo "[pull-lmk] * downloading /opt/minebest...FAILED" - exit $code -fi echo echo