diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-02-20 11:10:23 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-02-20 11:10:23 -0300 |
commit | efaacc68a2539cf57fdba395598f708d366cabc9 (patch) | |
tree | 3235b55b52df00c14ab99be9eb2255e3110b860b /lib/keyringer/actions/edit | |
parent | 10ec7a4f87812576f6bf3543282b49030ba77e64 (diff) | |
parent | 4b4aff2edac956224849d36fe83f826303d25efd (diff) | |
download | keyringer-efaacc68a2539cf57fdba395598f708d366cabc9.tar.gz keyringer-efaacc68a2539cf57fdba395598f708d366cabc9.tar.bz2 |
Merge tag 'upstream_keyringer_0.3' into debian
Upstream version 0.3
Diffstat (limited to 'lib/keyringer/actions/edit')
-rwxr-xr-x | lib/keyringer/actions/edit | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/keyringer/actions/edit b/lib/keyringer/actions/edit index 9a3e488..03ccdab 100755 --- a/lib/keyringer/actions/edit +++ b/lib/keyringer/actions/edit @@ -24,6 +24,7 @@ keyringer_set_tmpfile $BASENAME.$EXTENSION # Decrypt the information to the file $GPG --yes -o "$TMPWORK" --use-agent -d "$KEYDIR/$FILE" +# Action check if [ "$BASENAME" == "edit" ]; then APP="$EDITOR" elif [ "$BASENAME" == "open" ]; then @@ -43,5 +44,18 @@ $APP "$TMPWORK" # Encrypt again $GPG --yes -o "$KEYDIR/$FILE" --use-agent --armor -e -s $(keyringer_recipients "$RECIPIENTS_FILE") "$TMPWORK" +# Check exit status +errcrypt="$?" + # Remove temp file keyringer_unset_tmpfile "$TMPWORK" + +# Check exit status again +errwipe="$?" + +# Error handling must be done after temp file removal +if [ "$errcrypt" != "0" ]; then + exit "$errcrypt" +elif [ "$errwipe" != "0" ]; then + exit $errwipe +fi |