From edbc155a59673bb35afe62dce4c1eed8ce6fe171 Mon Sep 17 00:00:00 2001 From: Shy Date: Fri, 2 Aug 2024 08:39:05 +0200 Subject: [PATCH] Check curl exit code. --- wled | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wled b/wled index 7c1d178..f9d53b3 100755 --- a/wled +++ b/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