]>
Commit | Line | Data |
---|---|---|
1 | import sys | |
2 | import hetzner_helper | |
3 | ||
4 | instance = sys.argv[-1] | |
5 | actions = [] | |
6 | if "--rescue" in sys.argv: | |
7 | actions.append("enable_rescue") | |
8 | elif "--local" in sys.argv: | |
9 | actions.append("disable_rescue") | |
10 | ||
11 | if "--hard" in sys.argv: | |
12 | actions.append("reset") | |
13 | else: | |
14 | actions.append("reboot") | |
15 | ||
16 | for action in actions: | |
17 | result = hetzner_helper.post("servers/{}/actions/{}".format(instance, action)) | |
18 | print(result) |