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