X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=nagixsc_conf2http.py;h=3dece813d29ed6c3ffdf4060f333edbaeb27e365;hb=37db4aca3919bd1abd55a4eecccce70f814acad5;hp=abeed4e8252fc59dd494702cee06ff6c6a632ded;hpb=e49ca957f7c364fe2352f04e10c2529194c322da;p=nagixsc.git diff --git a/nagixsc_conf2http.py b/nagixsc_conf2http.py index abeed4e..3dece81 100755 --- a/nagixsc_conf2http.py +++ b/nagixsc_conf2http.py @@ -22,6 +22,7 @@ from nagixsc import * parser = optparse.OptionParser() parser.add_option('-c', '', dest='cfgfile', help='Config file') +parser.add_option('-d', '--daemon', action='store_true', dest='daemon', help='Daemonize, go to background') parser.add_option('', '--nossl', action='store_true', dest='nossl', help='Disable SSL (overwrites config file)') parser.set_defaults(cfgfile='conf2http.cfg') @@ -132,6 +133,9 @@ def main(): print 'SSL certificate "%s" not found!' % config['cert'] sys.exit(127) + if options.daemon: + daemonize(pidfile='/var/run/nagixsc_conf2http.pid') + server = MyHTTPServer((config['ip'], config['port']), Conf2HTTPHandler, ssl=config['ssl'], sslpemfile=config['cert']) try: server.serve_forever()