Check for openssl in crypt tool
This commit is contained in:
parent
2f635326dd
commit
26889fc6cc
12
crypt/crypt
12
crypt/crypt
|
@ -3,6 +3,16 @@
|
||||||
|
|
||||||
currentVersion="1.6.0"
|
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
|
## uses openssl aes 256 cbc encryption to encrypt file salting it with password designated by user
|
||||||
encrypt()
|
encrypt()
|
||||||
{
|
{
|
||||||
|
@ -70,6 +80,8 @@ usage()
|
||||||
echo " -v Get the tool version"
|
echo " -v Get the tool version"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkOpenSSL || exit 1
|
||||||
|
|
||||||
while getopts "huve:d:" opt; do ## alows for using options in bash
|
while getopts "huve:d:" opt; do ## alows for using options in bash
|
||||||
case $opt in
|
case $opt in
|
||||||
e) ## when trying to encrypt run this
|
e) ## when trying to encrypt run this
|
||||||
|
|
Loading…
Reference in New Issue