unique dump names uid.md5.(mfd|mfoc.txt)
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 23 Jan 2011 13:31:36 +0000 (14:31 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 23 Jan 2011 13:31:36 +0000 (14:31 +0100)
dump-card.sh

index 588cbac..b20532c 100755 (executable)
@@ -1,4 +1,18 @@
 #!/bin/sh -x
 
 # http://code.google.com/p/nfc-tools/wiki/mfoc
-mfoc -O $1 $keys.dump | tee $1-keys.txt
+
+uid=`nfc-list | grep UID | cut -d: -f2 | sed 's/ //g'`
+
+if [ -z "$uid" ] ; then
+       echo "No card on reader"
+       nfc-list
+       exit 1
+fi
+
+#mfoc -O $uid.mfd | tee $uid.mfoc.txt
+
+md5=`md5sum 32a0ee18.mfd | cut -d" " -f1`
+mv $uid.mfd $uid.$md5.mfd
+mv $uid.mfoc.txt $uid.$md5.mfoc.txt
+ls -al $uid.*