Untitled
unknown
plain_text
2 years ago
758 B
3
Indexable
#!/bin/bash host="localhost" port=11400 webserver_status=0 scheduler_status=0 (echo > /dev/tcp/$host/$port) > /dev/null 2>&1 # using telenet command if [ $? -eq 0 ]; then webserver_status=1 echo "Up" else webserver_status=0 echo "Down" fi (echo > /dev/tcp/$host/$port) > /dev/null 2>&1 status=$? # Check the exit code of the telnet command to see if the scheduler is up or down if [ $status -eq 0 ]; then scheduler_status=1 echo "Scheduler is Up" else scheduler_status=0 echo "Scheduler is Down" fi echo "$webserver_status" echo "$scheduler_status" if [$webserver_status -eq 0] && [$scheduler_status -eq 0]; then echo "starting both webserver and scheduler" airflow webserver -D airflow scheduler -D fi
Editor is loading...