Add usb_maker script, by Romain & Thomas

This commit is contained in:
nemunaire 2015-01-15 12:12:11 +01:00 committed by Nemunaire
parent 96f6df2e96
commit e94653acd8
2 changed files with 30 additions and 1 deletions

View File

@ -1,5 +1,6 @@
.git
TODO
db/
docs/guide
docs/guide/
misc/
perl-mcrypt/

28
misc/usb_maker.py Executable file
View File

@ -0,0 +1,28 @@
#!/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"