1
0
Fork 0
mirror of synced 2024-12-13 02:45:45 -05:00

Check exit code directly (SC2181)

This commit is contained in:
Tim Byrne 2017-01-06 17:05:06 -06:00
parent 2033e5673e
commit 635468b707
No known key found for this signature in database
GPG key ID: 6CBE24C2FD8CF76E

6
yadm
View file

@ -221,8 +221,7 @@ function decrypt() {
fi fi
#; decrypt the archive #; decrypt the archive
($GPG_PROGRAM -d "$YADM_ARCHIVE" || echo 1) | tar v${tar_option}f - -C "$YADM_WORK" if ($GPG_PROGRAM -d "$YADM_ARCHIVE" || echo 1) | tar v${tar_option}f - -C "$YADM_WORK"; then
if [ $? = 0 ] ; then
[ ! "$DO_LIST" = "YES" ] && echo "All files decrypted." [ ! "$DO_LIST" = "YES" ] && echo "All files decrypted."
else else
error_out "Unable to extract encrypted files." error_out "Unable to extract encrypted files."
@ -269,8 +268,7 @@ function encrypt() {
echo echo
#; encrypt all files which match the globs #; encrypt all files which match the globs
tar -f - -c "${GLOBS[@]}" | $GPG_PROGRAM --yes "${GPG_OPTS[@]}" --output "$YADM_ARCHIVE" if tar -f - -c "${GLOBS[@]}" | $GPG_PROGRAM --yes "${GPG_OPTS[@]}" --output "$YADM_ARCHIVE"; then
if [ $? = 0 ]; then
echo "Wrote new file: $YADM_ARCHIVE" echo "Wrote new file: $YADM_ARCHIVE"
else else
error_out "Unable to write $YADM_ARCHIVE" error_out "Unable to write $YADM_ARCHIVE"