From 26889fc6cc1003da3889a56520b7a90a425ba72f Mon Sep 17 00:00:00 2001 From: Alex Epstein Date: Sun, 2 Jul 2017 20:08:08 -0400 Subject: [PATCH] Check for openssl in crypt tool --- crypt/crypt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crypt/crypt b/crypt/crypt index fd9a556..994427e 100755 --- a/crypt/crypt +++ b/crypt/crypt @@ -3,6 +3,16 @@ currentVersion="1.6.0" + +checkOpenSSL() +{ + if ! command -v openssl &>/dev/null ;then + echo "Error: to use this tool openssl must be installed" >&2 + return 1 + else + return 0 + fi +} ## uses openssl aes 256 cbc encryption to encrypt file salting it with password designated by user encrypt() { @@ -70,6 +80,8 @@ usage() echo " -v Get the tool version" } +checkOpenSSL || exit 1 + while getopts "huve:d:" opt; do ## alows for using options in bash case $opt in e) ## when trying to encrypt run this