-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathgaps.py
More file actions
36 lines (28 loc) · 819 Bytes
/
gaps.py
File metadata and controls
36 lines (28 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/python
# Google Apps Passwords Sync for Samba4
# author Johan Johansson johan@baboons.se
# Free to use!
import time
import gapslib
import os.path
import sys
from daemon import runner
class App():
def __init__(self):
self.stdin_path = '/dev/null'
self.stdout_path = '/dev/null'
self.stderr_path = '/dev/null'
self.pidfile_path = '/var/run/gaps.pid'
self.pidfile_timeout = 60
if len(sys.argv) >= 2:
if sys.argv[1] == "start":
if(os.path.exists(self.pidfile_path)):
print "GAPS is already running. stop|start|restart"
sys.exit()
def run(self):
while True:
gapslib.run()
time.sleep(60)
app = App()
daemon_runner = runner.DaemonRunner(app)
daemon_runner.do_action()