Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Export or Dump a GPG/PGP key's details to a .info file
- # GPG keys have an .gpg as the file extension
- # NB: You must have `mutt` installed in order to use its `mutt_pgpring` script
- pname=`basename "$0"`
- KEY="$1"
- # Show colored message
- showmsg ()
- {
- echo $'\033[35m'"$@" 1>&2 $'\033[0m';
- }
- # Show errors
- error ()
- {
- echo $'\033[31m'"ERROR: $pname: $@" 1>&2 $'\033[0m';
- shift;
- }
- # Exit if NO GPG KEY FILE is given
- if test -z "$KEY"
- then
- error "You must specify a GPG/PGP KEY file";
- showmsg "SYNTAX: $pname <KEYFILE.gpg>";
- exit 1;
- else
- mutt_pgpring -k "$KEY" | tee "$KEY".info;
- showmsg "SUCESS: $KEY dumped to $KEY.info"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement