infra/verify.sh

32 lines
515 B
Bash
Raw Normal View History

2024-10-26 05:03:58 +02:00
#!/bin/sh
read mode
if [ "$mode" = "key" ] ; then
output="$( (exec gpg --import > /dev/null) 2>&1 )"
if [ "$?" = 0 ] ; then
echo recv ok > /dev/stderr
else
echo recv bad > /dev/stderr
exit 1
fi
exit
fi
if [ "$mode" = "data" ] ; then
id=$!
stderr="$( (exec gpg -d > /tmp/$id.msg) 2>&1 )"
if [ $? = 0 ] && ! grep "WARNING" <<< "$stderr" > /dev/null ; then
echo recv sig ok > /dev/stderr
else
echo recv sig bad > /dev/stderr
exit 1
fi
cat /tmp/$id.msg
exit
fi