# Online Bash Shell.
# Code, Compile, Run and Debug Bash script online.
# Write your code in this editor and press "Run" button to execute it.
#response='{"db":{"status":"healthy"},"scheduler":{"fetch":"2024-03-12T04:32:53.060917+00:00","status":"healthy"}}';
# python3 -c "import sys, json; print('FAIL' if json.loads(sys.argv[1])['scheduler']['status'] == 'healthy' else 'OK')" "$response"
#response='{"db":{"status":"healthy"},"scheduler":{"fetch":"2024-03-12T04:32:53.060917+00:00","status":"unhealthy"}}'; python3 -c "import sys, json; sys.exit(0 if json.loads(sys.argv[1])['scheduler']['status'] == 'healthy' else 1)" "$response"
response="";xxx=$(python3 -c "import sys, json; print(0 if sys.argv[1] and json.loads(sys.argv[1])['scheduler']['status'] == 'healthy' else 1)" "$response"); if [ $xxx -eq 0 ]; then exit 0; else exit 1; fi