#!/bin/bashurl="http://example.com" # 替换为你要检查的网址http_status=$(curl -s -o /dev/null -w "%{http_code}" $url)if [ "$http_status" != "200" ]; then echo "HTTP status code is not 200. Rebooting the system..." sudo rebootelse echo "HTTP status code is 200. No reboot necessary."fi