29 lines
982 B
Python
29 lines
982 B
Python
|
#!/usr/bin/env python
|
||
|
|
||
|
# Import the certificate and the guide into the usb keys
|
||
|
# It needs a file (teams) which contains "certificate_name number"
|
||
|
# certificate_name : is the name of the file into the cert/ folder
|
||
|
# number : how many usb stick it must copy
|
||
|
# A guide.pdf must also be present
|
||
|
|
||
|
import os
|
||
|
|
||
|
separator = ' '
|
||
|
device = '/dev/sdb1'
|
||
|
|
||
|
with open("teams") as f:
|
||
|
for line in f:
|
||
|
cert, members = line.split(separator)
|
||
|
for x in range(0,int(members)):
|
||
|
raw_input("Insert usb AND THEN press enter")
|
||
|
os.system("sleep 4")
|
||
|
os.system("mkfs.vfat " + device)
|
||
|
os.system("mount " + device + " /media")
|
||
|
os.system("cp -v cert/" + cert + " guide.pdf /media")
|
||
|
os.system("umount /media")
|
||
|
print "## " + cert + " was copied to usb device " + x + "/" + members
|
||
|
os.system("sleep 0.4")
|
||
|
print "You may eject the usb key"
|
||
|
print "Next Team"
|
||
|
print "DONE"
|