verifyfse.sh 1.1 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. #precondition
  3. #wget https://freespeechextremist.com/media/888a4629af8e592774e0fc9cb047c48f33313ac9739de9bc3cc3ee241af4c2ce.asc?name=warrantcanary.asc
  4. #gpg --import 888a4629af8e592774e0fc9cb047c48f33313ac9739de9bc3cc3ee241af4c2ce.asc\?name\=warrantcanary.asc
  5. TMPFILE=`mktemp`
  6. TMPFILE1=`mktemp`
  7. TMPFILE2=`mktemp`
  8. TMPFILE3=`mktemp`
  9. successfile=$TMPFILE3
  10. echo "gpg: using RSA key 768A07A25F0D2AE3816E00AAC7C3A3098FB70D9D" >> $successfile
  11. echo "gpg: Good signature from \"FSE Warrant Canary\" [unknown]" >> $successfile
  12. echo "gpg: WARNING: This key is not certified with a trusted signature!" >> $successfile
  13. echo "gpg: There is no indication that the signature belongs to the owner." >> $successfile
  14. echo "Primary key fingerprint: 768A 07A2 5F0D 2AE3 816E 00AA C7C3 A309 8FB7 0D9D" >> $successfile
  15. # echo $TMPFILE
  16. finger warrantcanary@freespeechextremist.com | sed -n '/^-/,/^-----END PGP SIGNATURE-----/p' > $TMPFILE
  17. gpg --verify $TMPFILE 2> $TMPFILE1
  18. #echo "cat $TMPFILE1"
  19. #cat $TMPFILE1
  20. tail -n 5 $TMPFILE1 > $TMPFILE2
  21. diff $successfile $TMPFILE2
  22. if [ $? -ne 0 ]; then
  23. echo "not good"
  24. else
  25. echo "good"
  26. fi