Browse Source

Correctly check return code of rsync.

master
Poikilos 2 days ago
parent
commit
7fd71bfe20
  1. 17
      utilities/pull-lmk

17
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." echo "Error: This should *not* be run on the server that has the master copy."
exit 1 exit 1
fi fi
code=
if [ "x$OFFLINE" = "xfalse" ]; then if [ "x$OFFLINE" = "xfalse" ]; then
rsync -rtlv --delete mtio:/opt/minebest/ /opt/minebest \ rsync -rtlv --delete mtio:/opt/minebest/ /opt/minebest \
--include "assemble/***" \ --include "assemble/***" \
@ -19,6 +20,15 @@ if [ "x$OFFLINE" = "xfalse" ]; then
--include "mtkit.txt" \ --include "mtkit.txt" \
--exclude "*" \ --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 fi
# l: copy symlinks as symlinks # l: copy symlinks as symlinks
# L: transform symlink into referent file/dir # 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 # the install source when using the maintainer rsync copy as the
# install source) # 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
echo echo

Loading…
Cancel
Save