summaryrefslogtreecommitdiff
path: root/yubiserve.py
diff options
context:
space:
mode:
Diffstat (limited to 'yubiserve.py')
-rwxr-xr-xyubiserve.py27
1 files changed, 13 insertions, 14 deletions
diff --git a/yubiserve.py b/yubiserve.py
index 43f0d29..226f8c9 100755
--- a/yubiserve.py
+++ b/yubiserve.py
@@ -393,20 +393,19 @@ if config['yubiDB'] == 'mysql' and (config['yubiMySQLHost'] == '' or config['yub
print "Cannot continue without any MySQL configuration.\nPlease read README.\n\n"
quit()
-yubiserveHTTP = ThreadingHTTPServer((config['yubiserveHOST'], config['yubiservePORT']), YubiServeHandler)
-yubiserveSSL = ThreadingHTTPSServer((config['yubiserveHOST'], config['yubiserveSSLPORT']), YubiServeHandler)
-
-http_thread = Thread(target=yubiserveHTTP.serve_forever)
-ssl_thread = Thread(target=yubiserveSSL.serve_forever)
-
-http_thread.setDaemon(True)
-ssl_thread.setDaemon(True)
-
-http_thread.start()
-ssl_thread.start()
-
-print "HTTP Server is running."
+if config.has_key('yubiservePORT'):
+ yubiserveHTTP = ThreadingHTTPServer((config['yubiserveHOST'], config['yubiservePORT']), YubiServeHandler)
+ http_thread = Thread(target=yubiserveHTTP.serve_forever)
+ http_thread.setDaemon(True)
+ http_thread.start()
+ print "HTTP Server is listening on %s:%d" % (config['yubiserveHOST'],config['yubiservePORT'])
+
+if config.has_key('yubiserveSSLPORT'):
+ yubiserveSSL = ThreadingHTTPSServer((config['yubiserveHOST'], config['yubiserveSSLPORT']), YubiServeHandler)
+ ssl_thread = Thread(target=yubiserveSSL.serve_forever)
+ ssl_thread.setDaemon(True)
+ ssl_thread.start()
+ print "HTTPS Server is listening on %s:%d" % (config['yubiserveHOST'],config['yubiserveSSLPORT'])
while 1:
time.sleep(1)
-