Check curl exit code.
This commit is contained in:
parent
4fcb815c14
commit
edbc155a59
1 changed files with 6 additions and 0 deletions
6
wled
6
wled
|
@ -52,6 +52,12 @@ case "$2" in
|
|||
;;
|
||||
esac
|
||||
|
||||
curl_exit=$?
|
||||
if test $curl_exit -ne 0; then
|
||||
echo "Error: curl exited with exit code $curl_exit."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check API responce. Should be {"success":true}.
|
||||
if test "$(echo -n "$api_resp"|tr -c -d '[:alpha:]')" != 'successtrue'; then
|
||||
echo "Error: unexpected responce from WLED API." >&2
|
||||
|
|
Loading…
Reference in a new issue