Password Sync for Samba4
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

syncpassword.py 751B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/python
  2. import time
  3. import libsyncpassword
  4. import os.path
  5. import sys
  6. from daemon import runner
  7. class App():
  8. def __init__(self):
  9. self.stdin_path = '/dev/null'
  10. self.stdout_path = '/dev/null'
  11. self.stderr_path = '/dev/null'
  12. self.pidfile_path = '/var/run/pwdazure.pid'
  13. self.pidfile_timeout = 60
  14. if len(sys.argv) >= 2:
  15. if sys.argv[1] == "start":
  16. if(os.path.exists(self.pidfile_path)):
  17. print( "SyncPassword is already running. stop|start|restart")
  18. sys.exit()
  19. def run(self):
  20. while True:
  21. libsyncpassword.run()
  22. time.sleep(60)
  23. app = App()
  24. daemon_runner = runner.DaemonRunner(app)
  25. daemon_runner.do_action()