Skip to content

Instantly share code, notes, and snippets.

@azcoigreach
Last active August 27, 2019 20:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azcoigreach/fb432a15dd30ce78883d40cd6fad6ace to your computer and use it in GitHub Desktop.
Save azcoigreach/fb432a15dd30ce78883d40cd6fad6ace to your computer and use it in GitHub Desktop.
Receive message from Tasker. Sign with Keybase PGP. Return signature.
#!/usr/bin/expect -f
#am broadcast --user 0 -a net.dinglish.tasker.[task name] -e [variable name] "[value]" > /dev/null
#Send passphrase as argument to keybase for PGP SIGN from pgp_input.txt to pgp_output.txt
#Uses Tasker, Termux and Keybase
set timeout -1
set PGP_PASS [lindex $argv 0];
spawn keybase --standalone pgp sign -c -o pgp_output.txt -i /data/data/com.termux/files/home/storage/shared/pgp_input.txt
expect {
"re:" {
send "$PGP_PASS\r"
}
}
sleep 2
set OUTPUT [exec cat pgp_output.txt]
exec am broadcast --user 0 -a net.dinglish.tasker.keybasesignature -e keybase_signature $OUTPUT > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment