added test to avoid attempting to overwrite files directly in $AONDIR
[project-aon.git] / common / scripts / copy-ebooks.sh
index 3c39738..aea05d5 100755 (executable)
@@ -15,6 +15,11 @@ if [ ! -d "$AONDIR" ]; then
 fi
 CURR_DIR=`pwd`
 
+if [ "$AONDIR" -ef "$CURR_DIR" ]; then
+    >&2 echo "Current directory is the same as AONDIR: giving up"
+    exit
+fi
+
 BASE_DIR="$AONDIR/common/epub"
 book_db="$AONDIR/common/sqlite/bookcodes.db"