kill server when not responding

This commit is contained in:
iceBear67 committed 2024-09-17 15:41:50 +08:00
1 parent dadbbb30e5
commit 266943db73
1 file changed
+9 -2
+9 -2
View File
@@ -32,6 +32,13 @@ special_curl "$API_ENDPOINT/api/client/servers/$SERVER_ID/command" -H "Content-T
echo "Broadcast is sent!" echo "Broadcast is sent!"
sleep 10s sleep 10s
special_curl "$API_ENDPOINT/api/client/servers/$SERVER_ID/power" -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" -X POST -d "{\"signal\":\"restart\"}" special_curl "$API_ENDPOINT/api/client/servers/$SERVER_ID/power" -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" -X POST -d "{\"signal\":\"stop\"}"
echo "Signal is sent!" echo "STOP is sent!"
sleep 60s
special_curl "$API_ENDPOINT/api/client/servers/$SERVER_ID/power" -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" -X POST -d "{\"signal\":\"kill\"}"
echo "KILL is sent!"
sleep 15s
special_curl "$API_ENDPOINT/api/client/servers/$SERVER_ID/power" -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" -X POST -d "{\"signal\":\"start\"}"
echo "START IS SENT"