mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Add capability take a text file containing one MAC per line and weak each minion
This commit is contained in:
parent
9277590342
commit
8037861954
@ -16,12 +16,12 @@ def wollist(maclist, bcast='255.255.255.255', destport=9):
|
||||
salt-run '/path/to/maclist' 255.255.255.255 7
|
||||
'''
|
||||
try:
|
||||
macfile = open(maclist, 'r')
|
||||
for mac in macfile:
|
||||
wol(mac, bcast, destport)
|
||||
print "Waking up %s" % mac
|
||||
except:
|
||||
print "Failed to open the MAC file"
|
||||
file = open(maclist, 'r')
|
||||
for mac in file:
|
||||
wol(mac.strip(), bcast, destport)
|
||||
print "Waking up %s" % mac.strip()
|
||||
except Exception as inst:
|
||||
print "Failed to open the MAC file. Error: %s" % inst
|
||||
|
||||
def wol(mac, bcast='255.255.255.255', destport=9):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user