Skip to content

Commit

Permalink
add fallback to productLineDescription in case systemDescription is b…
Browse files Browse the repository at this point in the history
…lank (and it happens A LOT!)
  • Loading branch information
kcgthb committed Aug 30, 2024
1 parent e1f8493 commit 664f289
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dell_warranty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ if [[ -n $DELL_API_KEY ]] && [[ -n $DELL_API_SEC ]]; then
err "service tag not found ($svctag)"

c_prod=$(jq -r .systemDescription <<< "$o")
[[ "$c_prod" == "null" ]] && {
c_prod=$(jq -r .productLineDescription <<< "$o")
}
w_ctry=$(jq -r .countryCode <<< "$o")
w_rshp=$(jq -r .shipDate <<< "$o")
w_shpdate=$(date +%s --date="$w_rshp") # epoch
Expand Down Expand Up @@ -310,7 +313,3 @@ else
echo "-------------------------------------------"
done
fi




0 comments on commit 664f289

Please sign in to comment.