assuan/
[gnupg.git] / checks / mkdemodirs
blobb0755ab48d2e41a9afbcec1df2f8151e68259cff
1 #!/bin/sh
3 set -e
5 GPG="../g10/gpg --batch --quiet --no-secmem-warning"
6 NAMES='Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India
7 Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo
8 Sierra Tango Uniform Victor Whisky XRay Yankee Zulu'
10 if [ "$1" = "--clean" ]; then
11 for i in $NAMES; do
12 [ -d $i ] && rm -r $i
13 done
14 exit 0
17 $GPG --dearmor -o secdemo.gpg --yes ../checks/secdemo.asc
18 $GPG --dearmor -o pubdemo.gpg --yes ../checks/pubdemo.asc
19 [ -f ./tdb.tmp ] && rm ./tdb.tmp
20 GPGDEMO="$GPG --homedir . --trustdb-name ./tdb.tmp --no-default-keyring
21 --keyring pubdemo.gpg --secret-keyring secdemo.gpg"
22 /bin/echo "Creating:\c"
23 for name in $NAMES; do
24 /bin/echo " $name\c"
25 [ -d $name ] && rm -r $name
26 mkdir $name
27 $GPGDEMO --export-secret-key -o - $name | tee $name/Secret.gpg | \
28 $GPG --homedir $name --import
29 $GPGDEMO --export -o - $name | tee $name/Public.gpg | \
30 $GPG --homedir $name --import
31 [ -f $name/pubring.gpg~ ] && rm $name/pubring.gpg~
32 done
33 echo "."
34 [ -f ./tdb.tmp ] && rm ./tdb.tmp
35 rm pubdemo.gpg secdemo.gpg