blob: 7452afe393810ef5568b8de7d6e643b12c63f697 (
plain) (
tree)
|
|
import sys
import hetzner_helper
instance = sys.argv[-1]
actions = []
if "--rescue" in sys.argv:
actions.append("enable_rescue")
elif "--local" in sys.argv:
actions.append("disable_rescue")
if "--hard" in sys.argv:
actions.append("reset")
else:
actions.append("reboot")
for action in actions:
result = hetzner_helper.post("servers/{}/actions/{}".format(instance, action))
print(result)
|