Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2007-12-24 13:28:08 +0000
committershtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2007-12-24 13:28:08 +0000
commit68ede1f82acced4b71542f063cde3aba434758d7 (patch)
treea8f9b19134fb119080b6a9a855457297ced7b47c /make_fingerprints_flyer.sh
parent6667c96620fcb37a781deac2ce8872c3aeab4614 (diff)
[scripts] One more script.
git-svn-id: svn+ssh://scm.narf.ssji.net/svn/shtrom/scripts@93 1991c358-8f32-0410-a49a-990740bdf4c2
Diffstat (limited to 'make_fingerprints_flyer.sh')
-rwxr-xr-xmake_fingerprints_flyer.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/make_fingerprints_flyer.sh b/make_fingerprints_flyer.sh
new file mode 100755
index 0000000..f5b58d0
--- /dev/null
+++ b/make_fingerprints_flyer.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+LATEX="pdflatex"
+MAXLINES=176
+
+KEYID=${1:-E3462FD1}
+FILENAME=fingerprint_${KEYID}
+
+FP=`gpg --no-secmem-warning --fingerprint ${KEYID}| grep "\(^pub\|^uid\|fingerprint\)"`
+NLINES=0
+oldIFS=${IFS}
+IFS="
+"
+for line in ${FP}; do
+ NLINES=$((NLINES + 1))
+done
+IFS=${oldIFS}
+
+(
+cat << EOF
+\\documentclass[a4paper]{letter}
+ \\usepackage{multicol}
+% \\usepackage{vmargin}
+% \\setmarginsrb{10mm}{10mm}{10mm}{10mm}{0mm}{0mm}{0mm}{0mm}
+ \\pagestyle{empty}
+\\begin{document}
+ \\begin{multicols}{2}
+ \\tiny{
+EOF
+oldIFS=${IFS}
+IFS="
+"
+CURLINES=0
+while [ $((CURLINES + NLINES)) -le ${MAXLINES} ]; do
+ echo "\\begin{verbatim}"
+ for line in ${FP}; do
+ echo $line
+ done
+ CURLINES=$((CURLINES + NLINES))
+ echo "\\end{verbatim}\\"
+done
+IFS=${oldIFS}
+cat << EOF
+ }
+ \\end{multicols}
+\\end{document}
+EOF
+) > ${FILENAME}.tex
+
+${LATEX} ${FILENAME}.tex
+if [ $? = 0 ]; then
+ rm ${FILENAME}.{tex,aux,log}
+fi