git.infertux.com bin-scripts / master gpg-remove-expired-keys
master

Tree @master (Download .tar.gz)

gpg-remove-expired-keys @masterraw · history · blame

1
2
3
4
5
6
7
8
9
#!/bin/bash

expired_keys="$(gpg --list-keys --fixed-list-mode --with-colons | grep "^pub:e:" | cut -f5 -d":")"

for key in $expired_keys; do
    gpg --list-keys $key
    gpg --no-greeting --delete-key $key # will ask for confirmation
    echo
done