From b3109c859ea47baccc0c8480b4a05b500fed29ab Mon Sep 17 00:00:00 2001 From: Shy Date: Sat, 3 Aug 2024 23:24:07 +0200 Subject: [PATCH] Simplified check of API response. --- wled | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wled b/wled index 946d282..a35e524 100755 --- a/wled +++ b/wled @@ -10,7 +10,7 @@ CURL_FLAGS="--silent --show-error --fail --ipv4 --max-filesize 64K" print_usage() { echo "Usage: $0 f(nordcenter)|w(ohnzimmer) on|off|1-17|list" - echo " $0 f(nordcenter)|w(ohnzimmer) b(rightness) [1-255]" + echo " $0 f(nordcenter)|w(ohnzimmer) b(rightness) 1-255" } # Parse host argument. @@ -90,8 +90,8 @@ if test $curl_exit -ne 0; then exit 1 fi -# Check API responce. Should be {"success":true}. -if test "$(echo -n "$api_resp"|tr -c -d '[:alpha:]')" != 'successtrue'; then +# Check API responce. +if test "$api_resp" != '{"success":true}'; then echo "Error: unexpected responce from WLED API." >&2 exit 1 fi