remove timestamp and then parse dmesg
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 19 Jan 2014 14:36:03 +0000 (09:36 -0500)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 19 Jan 2014 14:36:03 +0000 (09:36 -0500)
reset-reader.sh

index 2f09071..cf1d31d 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh -xe
 
 #dev=`lsusb | grep 076b:5.21 | awk '{ print $2 "-" $4 }' | sed -e 's/0//g' -e 's/://'`
-dev=`dmesg | grep OMNIKEY | cut -d" " -f3 | cut -d: -f1 | tail -1`
+dev=`dmesg | grep OMNIKEY | sed 's/\[.*\] //'  | cut -d" " -f2 | cut -d: -f1 | tail -1`
 authorized=/sys/bus/usb/devices/$dev/authorized
 test -w $authorized || exit 1
 echo 0 > $authorized