We don't want to try and match the same patron to oneself.
authorChris Sharp <csharp@georgialibraries.org>
Mon, 27 Oct 2014 16:57:50 +0000 (12:57 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Mon, 27 Oct 2014 16:57:50 +0000 (12:57 -0400)
patron-merge-tools/unmerge.sh

index 9132633..87f53d7 100755 (executable)
@@ -36,6 +36,11 @@ PSQL_USER="evergreen"
 read -p "Please enter the lead patron's barcode: " LEAD_PATRON_BARCODE
 read -p "Please enter the merged patron's barcode: " MERGE_PATRON_BARCODE
 
+if [ "$LEAD_PATRON_BARCODE" = "$MERGE_PATRON_BARCODE" ]; then
+        echo "Barcodes must be different from each other."
+        exit 1;
+fi
+
 read -d '' LEAD_PATRON_SQL <<EOF
 SELECT usr
 FROM actor.card