Check for openssl in crypt tool

This commit is contained in:
Alex Epstein 2017-07-02 20:08:08 -04:00
parent 2f635326dd
commit 26889fc6cc
1 changed files with 12 additions and 0 deletions

View File

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