No Description

new_guest_password.py 446B

1234567891011121314151617181920212223
  1. #!/usr/bin/env python3
  2. import random
  3. import os
  4. from main import users_file
  5. newpass = ''.join(random.sample('abcdfghjkmnpqrstuvwxyz',8))
  6. f = open(users_file)
  7. lines = f.readlines()
  8. f.close()
  9. f = open(users_file,"w")
  10. for line in lines:
  11. if line.startswith("guest"):
  12. f.write('guest Cleartext-Password := "{}"\n'.format(newpass))
  13. else:
  14. f.write(line)
  15. f.close()
  16. os.system("/home/ateijelo/programs/dpto2/sendhup freeradius")