Add scripts from mblaze/contrib
Directly from tag v6.0, e0733f187b34b21fa8335b9914c29a28fa2e856d.
This commit is contained in:
parent
69e00b6f58
commit
eb605487e5
5 changed files with 111 additions and 2 deletions
20
mblaze/contrib/mgpg
Executable file
20
mblaze/contrib/mgpg
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
tmp=$(mktemp -t mgpg.XXXXXX)
|
||||
trap "rm -f '$tmp'" INT TERM EXIT
|
||||
|
||||
{
|
||||
echo "Content-Type: $PIPE_CONTENTTYPE"
|
||||
echo
|
||||
cat
|
||||
} > "$tmp"
|
||||
|
||||
n=$(mshow -t "$tmp" | awk -F: '
|
||||
/: application\/pgp-encrypted/ {supported = 1}
|
||||
/: application\/octet-stream/ {if (supported) print $1}')
|
||||
|
||||
if [ "$n" ]; then
|
||||
mshow -O "$tmp" "$n" | gpg2 -d 2>&1 || exit 0
|
||||
exit 64
|
||||
fi
|
||||
exit 63
|
Loading…
Add table
Add a link
Reference in a new issue