20 lines
448 B
Python
Executable File
20 lines
448 B
Python
Executable File
#!/usr/bin/python3
|
|
|
|
try:
|
|
fh = open("user.txt", "r")
|
|
except:
|
|
print ("Fichier user.txt inconnu")
|
|
else:
|
|
line = fh.readline ()
|
|
while line:
|
|
# use realine() to read next line
|
|
maligne = line.rstrip()
|
|
(login,complet)=maligne.split(":")
|
|
print(login , complet)
|
|
cmd = "useradd -m -c \""+ complet + "\" " + login + "-s /bin/bash/ "+login
|
|
print (cmd)
|
|
line = fh.readline()
|
|
|
|
fh.close()
|
|
|