mirror of
https://github.com/deajan/obackup.git
synced 2025-01-12 07:03:54 +01:00
Minor decrypt tweaks
This commit is contained in:
parent
4524df8a76
commit
afce24c7ec
@ -10,7 +10,7 @@ PROGRAM="obackup"
|
|||||||
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
||||||
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
|
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
|
||||||
PROGRAM_VERSION=2.1-dev
|
PROGRAM_VERSION=2.1-dev
|
||||||
PROGRAM_BUILD=2016122804
|
PROGRAM_BUILD=2016123101
|
||||||
IS_STABLE=no
|
IS_STABLE=no
|
||||||
|
|
||||||
include #### OFUNCTIONS FULL SUBSET ####
|
include #### OFUNCTIONS FULL SUBSET ####
|
||||||
@ -1157,8 +1157,10 @@ function DecryptFiles {
|
|||||||
local cryptToolSubVersion
|
local cryptToolSubVersion
|
||||||
local cryptFileExtension="$CRYPT_FILE_EXTENSION"
|
local cryptFileExtension="$CRYPT_FILE_EXTENSION"
|
||||||
|
|
||||||
|
local retval
|
||||||
|
|
||||||
if [ ! -w "$filePath" ]; then
|
if [ ! -w "$filePath" ]; then
|
||||||
Logger "Directory [$filePath] is not writable. Cannot decrypt files." "CRITICAL"
|
Logger "Path [$filePath] is not writable or does not exist. Cannot decrypt files." "CRITICAL"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -1190,9 +1192,10 @@ function DecryptFiles {
|
|||||||
while IFS= read -r -d $'\0' encryptedFile; do
|
while IFS= read -r -d $'\0' encryptedFile; do
|
||||||
Logger "Decrypting [$encryptedFile]." "VERBOSE"
|
Logger "Decrypting [$encryptedFile]." "VERBOSE"
|
||||||
$CRYPT_TOOL $options --out "${encryptedFile%%$cryptFileExtension}" $additionalParameters $secret --decrypt "$encryptedFile" > "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP" 2>&1
|
$CRYPT_TOOL $options --out "${encryptedFile%%$cryptFileExtension}" $additionalParameters $secret --decrypt "$encryptedFile" > "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP" 2>&1
|
||||||
if [ $? != 0 ]; then
|
retval=$?
|
||||||
|
if [ $retval != 0 ]; then
|
||||||
Logger "Cannot decrypt [$encryptedFile]." "ERROR"
|
Logger "Cannot decrypt [$encryptedFile]." "ERROR"
|
||||||
Logger "Command output\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP)" "DEBUG"
|
Logger "Command output\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP)" "NOTICE"
|
||||||
errorCounter=$((errorCounter+1))
|
errorCounter=$((errorCounter+1))
|
||||||
else
|
else
|
||||||
successCounter=$((successCounter+1))
|
successCounter=$((successCounter+1))
|
||||||
|
Loading…
Reference in New Issue
Block a user