Auto pgp-sign news
Article: 7542 of alt.hackers From: ayman@ccwf.cc.utexas.edu (Ayman M. El-Khashab) Newsgroups: alt.hackers Subject: Auto pgp-sign news Date: 26 Mar 1995 15:59:14 GMT Organization: The University of Texas at Austin, Austin, Texas Lines: 85 Approved: me! Message-ID: 3l430i$g21@geraldo.cc.utexas.edu NNTP-Posting-Host: slip-26-1.ots.utexas.edu X-Newsreader: TIN [version 1.2 PL2] Status: RO
-----BEGIN PGP SIGNED MESSAGE----- I also have a script that will automatically sign news using your pgp signature feature. You can either set the PGPPASS environment variable or it will prompt you for the pass phrase, I use it with tin, but it *SHOULD* work with other readers but I haven't tried it. By default, tin starts the vi editor with the command line vi +%N %F. This starts vi at line N of file F. This script can just replace the name of the editor. for instance, if you name the script auto_pgp, your command line would look like this auto_pgp +%N %F If you are not using the open at line x feature, you will either have to edit the script or just make the command line auto_pgp +1 %F. Now it will always start at the first line. The nice thing about this is that you get the full vi editor with the header and everything exactly as it would appear. The script then takes your article and splits the header and message into two different files. Then it signs the message file and rebuilds the article, then it returns to the news reader and you can post or do whatever options the newsreader has. It isn't as good as the other one that was posted here, because you can't re-edit an article. Next version I'll try that. So here it is: #!/bin/sh # Auto signer that works with tin # Ayman M. Elkhashab # Send requests/ bugs to ayman@ccwf.cc.utexas.edu # start the editor to edit the post vi $1 $2 # Separate the header and the message header=0 # variable set at end of header cat $2 | # pipe file through filter while read line do if [ $header -eq 0 ]; then #outputs header & message to dif files echo $line | sed 's/:$/: /' >> header.$$ #fixes lines ending in colons if [ -z "$line" ]; then header=1 #sets header end and write rest to another fi #file with the message else echo $line >> message.$$ fi done # Begin the PGP portion of the script. Sign the message. pgp -sta message.$$ # Rebuild the Post cat header.$$ message.$$.asc > $2 # Remove all of the Temporary files rm header.$$ rm message.$$ rm message.$$.asc # Exit the script exit - -- _____________________________________________________________ For the Public Key, finger ayman@ccwf.cc.utexas.edu or WWW at http://ccwf.cc.utexas.edu/~ayman/main.html Why is it always easier to volunteer than to unvolunteer? - ------------------------------------------------------------- -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBL3WOqU45m/iMbhP9AQGlHwP8DPh2xq/hSoin7NE3LhNcaRUxqivSS1fQ elk7JJc4v6ve7lXcWP3tdjuC5CVB38YEUC7GWKMyMLsBqtmZPf9b/EftnVQchUo4 oTQO3Rs6oAf31PuM+JODkNMwpxBb9m/zyC6RF1HOHvmbtFLy2AeJ6eEE29X5pAm5 DVhBzk4wtBE= =EAQr -----END PGP SIGNATURE-----