From 635880b482b55d2efeb1ee294d32783bf0ff9274 Mon Sep 17 00:00:00 2001 From: 3err0 Date: Wed, 10 Jun 2020 21:46:46 +0800 Subject: [PATCH] if first url wrong, then use api reboot method --- rebootasic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rebootasic b/rebootasic index 17c9d6d..b375fbb 100755 --- a/rebootasic +++ b/rebootasic @@ -16,7 +16,8 @@ try: if response.status==401: print "Unauthorized, Wrong PASSWORD" elif response.status==404: - print "Wrong Request Address" + URL = "http://"+sys.argv[1]+"/api/reboot" + response, content = h.request(URL, "GET", headers={'cache-control':'no-cache'}) except httplib2.ServerNotFoundError: print "HOST is Down" except (socket.timeout, socket.error, httplib2.HttpLib2Error, httplib.ResponseNotReady):