diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-02-26 12:32:05 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-02-26 12:32:05 -0300 |
commit | 67adc630f06c7779937a410f1d5925ad51f6e017 (patch) | |
tree | 4e4e9b1b8812c5ead1e0d8e78eadc6c0470b0f5f | |
parent | 27b131115b3e983575cc2f64c695d2269baa15e6 (diff) | |
download | keyringer-67adc630f06c7779937a410f1d5925ad51f6e017.tar.gz keyringer-67adc630f06c7779937a410f1d5925ad51f6e017.tar.bz2 |
Check return status (closes #7)
-rw-r--r-- | lib/keyringer/functions | 4 | ||||
-rwxr-xr-x | share/keyringer/append | 6 | ||||
-rwxr-xr-x | share/keyringer/encrypt | 8 |
3 files changed, 18 insertions, 0 deletions
diff --git a/lib/keyringer/functions b/lib/keyringer/functions index 129ec0e..1d29157 100644 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -74,6 +74,10 @@ function keyringer_exec { # Dispatch if keyringer_has_action "$action"; then "$ACTIONS/$action" "$basedir" $* + err="$?" + if [ "$err" != "0" ]; then + exit "$err" + fi fi } diff --git a/share/keyringer/append b/share/keyringer/append index 045ba86..bcc9e5e 100755 --- a/share/keyringer/append +++ b/share/keyringer/append @@ -32,4 +32,10 @@ for element in $(seq 0 $((${#NEW[@]} - 1))); do echo ${NEW[$element]} done | keyringer_exec encrypt-batch $BASEDIR $FILE +err="$?" + +if [ "$err" != "0" ]; then + exit "$err" +fi + IFS="$OLDIFS" diff --git a/share/keyringer/encrypt b/share/keyringer/encrypt index da0941f..3680d0b 100755 --- a/share/keyringer/encrypt +++ b/share/keyringer/encrypt @@ -23,7 +23,15 @@ fi $GPG --use-agent --armor -e -s $(keyringer_recipients "$RECIPIENTS_FILE") - > "$KEYDIR/$FILE" +err="$?" + +if [ "$err" != "0" ]; then + exit "$err" +fi + # Stage if [ -d "$BASEDIR/.git" ]; then keyringer_exec git "$BASEDIR" add "keys/$FILE" fi + +exit "$?" |