1#!/usr/bin/gawk -f 2 3/-----BEGIN PGP SIGNED MESSAGE-----/ { 4 if (first_line_seen) 5 { 6 bogosity = 1; 7 exit; 8 } 9 else 10 { 11 print $0 | gpg_command; 12 first_line_seen = 1; 13 } 14 next; 15} 16 17 18/-----END PGP SIGNATURE-----/ { 19 if (!first_line_seen) 20 { 21 bogosity = 1; 22 exit; 23 } 24 else 25 { 26 print $0 | gpg_command; 27 last_line_seen = 1; 28 } 29 next; 30} 31 32 33{ 34 if (!first_line_seen || last_line_seen) 35 { 36 bogosity = 1; 37 exit; 38 } 39 else 40 { 41 print $0 | gpg_command; 42 } 43 next; 44} 45 46END { 47 if (bogosity || close(gpg_command)) 48 { 49 exit 1; 50 } 51 else 52 { 53 exit 0; 54 } 55} 56 57# tag: Tom Lord Mon Jan 26 19:49:35 2004 (tla/=gpg-check.awk) 58# 59