ask before running mfoc
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 2 Feb 2011 11:08:09 +0000 (12:08 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 2 Feb 2011 11:08:09 +0000 (12:08 +0100)
nfc-card-dumper.pl

index 33b17cd..ffdecc9 100755 (executable)
@@ -54,6 +54,10 @@ if ($r->init()) {
                        # disconnect from reader so we can run mfoc
                        RFID::Libnfc::nfc_disconnect($r->{_pdi});
 
+                       print "Dump this card with mfoc? [y] ";
+                       my $yes = <STDIN>; chomp $yes;
+                       exit unless $yes =~ m/y/i || $yes eq '';
+
                        my $file = "cards/$uid.keys";
                        unlink $file;
                        warn "# finding keys for card $uid with: mfoc -O $file\n";