Write a shell script to check if a website is up.

Code Playground
JavaScript (V8)
Loading...
Console Output
// Output will appear here...
// For React: ReactDOM.createRoot(rootElement).render(<App />);
Recommended Answer
#!/bin/bash
if curl -s --head  --request GET https://google.com | grep "200 OK" > /dev/null; then 
   echo "UP"
else
   echo "DOWN"
fi