diff options
-rwxr-xr-x | misc-scripts/ftpdir-cleanup | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/misc-scripts/ftpdir-cleanup b/misc-scripts/ftpdir-cleanup index 9331a4e..222811b 100755 --- a/misc-scripts/ftpdir-cleanup +++ b/misc-scripts/ftpdir-cleanup @@ -58,7 +58,18 @@ for arch in ${ARCHES[@]}; do exit 1 fi - bsdtar xf "$ftppath/$reponame.db.tar.$DB_COMPRESSION" + if [ ! -f "$ftppath/$reponame.db.tar.$DB_COMPRESSION" ]; then + echo "" + echo "ERROR: The file \"$ftppath/$reponame.db.tar.$DB_COMPRESSION\" could not be found, aborting." + echo "" + exit 1 + fi + + if ! bsdtar xf "$ftppath/$reponame.db.tar.$DB_COMPRESSION"; then + echo "" + echo "ERROR: Command failed: bsdtar xf \"$ftppath/$reponame.db.tar.$DB_COMPRESSION\"" + exit 1 + fi for pkg in *; do filename=$(grep -A1 '^%FILENAME%$' "${pkg}/desc" | tail -n1) |