From: Chris Sharp Date: Mon, 13 Jan 2014 18:42:21 +0000 (-0500) Subject: Improving error handling if we have problems with dirs. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7a5788d2dd13c4c6235ecda12a22a29818f50eaf;p=contrib%2Fpines.git Improving error handling if we have problems with dirs. --- diff --git a/grab-utility01-configs.sh b/grab-utility01-configs.sh index ca52c0d..69815ba 100755 --- a/grab-utility01-configs.sh +++ b/grab-utility01-configs.sh @@ -30,8 +30,10 @@ if [ ! -d $ARCHIVE_DIR ]; then mkdir $ARCHIVE_DIR fi -cd $ARCHIVE_DIR || echo "Could not cd to $ARCHIVE_DIR." - +cd $ARCHIVE_DIR || { + echo "Could not cd to $ARCHIVE_DIR." + exit; +} echo "Copying configuration directory $CONF_DIR..." cp -r $CONF_DIR . @@ -42,7 +44,10 @@ cp -r $OVERDUE_DIR . echo "Copying offline data directory $OFFLINE_DIR..." cp -r $OFFLINE_DIR . -cd $WORKING_DIR || echo "Could not cd to $WORKING_DIR" +cd $WORKING_DIR || { + echo "Could not cd to $WORKING_DIR" + exit; +} echo "Compressing directory..." tar czvf $ARCHIVE_DIR.tar.gz $ARCHIVE_DIR