Browse Source

added dependency checks

panda 5 months ago
parent
commit
11ccb1d2f8
2 changed files with 12 additions and 0 deletions
  1. BIN
      20231103_01_fakekitten_2_upload_anything_amazon_photos_01.jpeg
  2. 12 0
      FakeKitten.sh

BIN
20231103_01_fakekitten_2_upload_anything_amazon_photos_01.jpeg


+ 12 - 0
FakeKitten.sh

@@ -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"