kiss-repo

personal package repository
git clone git://bvnf.space/kiss-repo.git
Log | Files | Refs | README | LICENSE

build (817B)


      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
#!/bin/sh -e

# To export your public key, run
# gpg --export --armor YOURKEYID > files/YOURNAME.txt

# note that this installs all the keys as trusted
# (change the trust level number below to something less than 5)
# so this package should be carefully moderated and fingerprints verified.

# also note this produces a lot of messy output. A cleaner way
# (but less portable and less secure)
# would be to replace the second invocation of gpg with
# $ echo "trusted-key $keyid" >> ~/.gnupg/gpg.conf

for sig in *.txt; do
    keyid=$(
    gpg --import \
        --keyid-format long \
        "$sig" 2>&1 \
    | awk '/^gpg: key / {print substr($3, 1, length($3)-1)}' \
    | sed '2,$d' )
    gpg --command-fd 0 \
        --quiet \
        --expert \
        --edit-key "$keyid" \
        trust << EOF
5
y
q
EOF
done