Google Apps 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.

gaps.py 819B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/python
  2. # Google Apps Passwords Sync for Samba4
  3. # author Johan Johansson johan@baboons.se
  4. # Free to use!
  5. import time
  6. import gapslib
  7. import os.path
  8. import sys
  9. from daemon import runner
  10. class App():
  11. def __init__(self):
  12. self.stdin_path = '/dev/null'
  13. self.stdout_path = '/dev/null'
  14. self.stderr_path = '/dev/null'
  15. self.pidfile_path = '/var/run/gaps.pid'
  16. self.pidfile_timeout = 60
  17. if len(sys.argv) >= 2:
  18. if sys.argv[1] == "start":
  19. if(os.path.exists(self.pidfile_path)):
  20. print "GAPS is already running. stop|start|restart"
  21. sys.exit()
  22. def run(self):
  23. while True:
  24. gapslib.run()
  25. time.sleep(60)
  26. app = App()
  27. daemon_runner = runner.DaemonRunner(app)
  28. daemon_runner.do_action()