diff --git a/home/bin/oath b/home/bin/oath new file mode 100755 index 0000000..7047e9c --- /dev/null +++ b/home/bin/oath @@ -0,0 +1,20 @@ +#!/usr/bin/env expect -f + +set query [lindex $argv 0] + +spawn ykman oath code $query +expect "Enter your password:" + +stty -echo +expect_user -re "(.*)\n" +stty echo +set pin $expect_out(1,string) + +send "$pin\r\r" + +expect "Touch your YubiKey..." +expect -re {(\d{6})} + +set code $expect_out(1,string) + +system printf $code | pbcopy