Tomb/extras/test/utils.sh
Jaromil 3eb93acc18 Directory reorganization
This commit re-organizes all the source distribution contents to
present users with the simple script, while moving the rest in extras.
Also autoconf/automake scripts were removed, back to minimalism.

The rationale of this change is that Tomb really only consists of a
script and users with no extra needs should just be presented with
it with no need for anything else. Any other thing on top of the Tomb
script is an extra and can be even distributed separately or integrated
in distributions.
2013-05-18 17:29:37 +02:00

18 lines
441 B
Bash

sanity_tomb() {
tombsize=`stat $1 -c '%s'`
if [[ $tombsize -ge 12000000 ]] || [[ $tombsize -le 9000000 ]]; then
echo "Error: tomb size is wrong: $tombsize"
return 1
fi
keysize=`stat ${1}.key -c '%s'`
if [[ $keysize -le 400 ]]; then
echo "Error: key size is wrong: $keysize"
return 2
fi
keytype=`file =(egrep -v '^_' ${1}.key) -bi`
if ! [[ $keytype =~ application/pgp ]]; then
echo "Wrong type for keyfile"
return 3
fi
}