Improvement™

This commit is contained in:
Bandie 2018-04-04 16:24:52 +02:00
parent 600524809c
commit a7d27c5ee9
Signed by: Bandie
GPG Key ID: C1E133BC65A822DD
2 changed files with 27 additions and 11 deletions

9
ding
View File

@ -7,7 +7,11 @@ import sys, ssl, socket, os
import configparser
global exitcode
host = None
port = 0
cafile = None
certfile = None
keyfile = None
exitcode = 1
def readConfig():
@ -22,7 +26,6 @@ def readConfig():
cfg.read(CONFIG)
global host, port, cafile, certfile, keyfile
host = cfg.get("Client", "host")
port = int(cfg.get("Client", "port"))
@ -61,7 +64,7 @@ def send(conn, cmd):
print("The server seems to be crazy. Nothing sent.", file=sys.stderr)
conn.close()
quit(exitcode)
def main():

15
dingd
View File

@ -6,6 +6,20 @@
import ssl, socket, subprocess, time, os, sys
import configparser
CONFIG = None
host = None
port = 0
cafile = None
certfile = None
keyfile = None
pw_on = None
password = None
pwtimeout = 30
tmppw_on = None
context = None
bindsocket = None
def getTimestamp():
t = "[" + time.strftime("%Y-%m-%d %H:%M:%S") + "]"
@ -21,7 +35,6 @@ def execFromConfig(option, pw=False):
else:
return 5
else:
try: