added dependency checks

This commit is contained in:
panda 2023-11-04 00:10:18 +01:00
parent 7d8c60570c
commit 11ccb1d2f8
2 changed files with 12 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

View file

@ -6,6 +6,18 @@ if [ -z "$1" ] || [ -z "$2" ] || [[ $2 != "encode" && $2 != "decode" && $2 != "e
exit
fi
# check for prerequisites:
if ! [ -x "$(command -v convert)" ]; then
echo 'Error: convert (part of the imagemagick suite) is not installed.' >&2
exit 1
fi
if [ $2 = "encode_enc" ] || [ $(echo $1 | cut -d "_" -f1) = "FakeKittenENC" ]; then
if ! [ -x "$(command -v gpg)" ]; then
echo 'Error: gpg is not installed, it is needed for encryption/decryption' >&2
exit 1
fi
fi
if [ $2 = "encode" ] || [ $2 = "encode_enc" ]; then
imagejpg="random.jpg"