Browse Source

Make Shellcheck happier about exit codes

Ondrej Simek 7 years ago
parent
commit
baa1160594
1 changed files with 3 additions and 1 deletions
  1. 3 1
      dnsapi/dns_he.sh

+ 3 - 1
dnsapi/dns_he.sh

@@ -94,10 +94,12 @@ dns_he_rm() {
   _post "$body" "https://dns.he.net/" \
   _post "$body" "https://dns.he.net/" \
     | grep '<div id="dns_status" onClick="hideThis(this);">Successfully removed record.</div>' \
     | grep '<div id="dns_status" onClick="hideThis(this);">Successfully removed record.</div>' \
       >/dev/null
       >/dev/null
-  if [ "$?" -eq 0 ]; then
+  exit_code="$?"
+  if [ "$exit_code" -eq 0 ]; then
     _info "Record removed successfuly."
     _info "Record removed successfuly."
   else
   else
     _err "Could not clean (remove) up the record. Please go to HE administration interface and clean it by hand."
     _err "Could not clean (remove) up the record. Please go to HE administration interface and clean it by hand."
+    return "$exit_code"
   fi
   fi
 }
 }