Move reset script to Python

This commit is contained in:
Khue Doan 2020-11-12 22:50:27 +07:00
parent 2e12cd8a29
commit 19ec331f1a
2 changed files with 17 additions and 6 deletions

17
infra/scripts/reset.py Executable file
View File

@ -0,0 +1,17 @@
#!/bin/python
import os
user = "root"
nodes = [
"node0.homelab.local",
"node1.homelab.local",
"node2.homelab.local",
"node3.homelab.local"
]
for node in nodes:
print(f"ssh {user}@{node} poweroff")
os.system(f"ssh {user}@{node} poweroff")

View File

@ -1,6 +0,0 @@
#!/bin/sh
ssh root@node0.homelab.local 'efibootmgr --bootnext 0006 && poweroff'
ssh root@node1.homelab.local 'efibootmgr --bootnext 0006 && poweroff'
ssh root@node2.homelab.local 'efibootmgr --bootnext 0006 && poweroff'
ssh root@node3.homelab.local 'efibootmgr --bootnext 0006 && poweroff'