Merge branch 'master' of github.com:Bandie/ding
This commit is contained in:
commit
36dd610965
9
ding
9
ding
@ -7,7 +7,11 @@ import sys, ssl, socket, os
|
|||||||
import configparser
|
import configparser
|
||||||
|
|
||||||
|
|
||||||
global exitcode
|
host = None
|
||||||
|
port = 0
|
||||||
|
cafile = None
|
||||||
|
certfile = None
|
||||||
|
keyfile = None
|
||||||
exitcode = 1
|
exitcode = 1
|
||||||
|
|
||||||
def readConfig():
|
def readConfig():
|
||||||
@ -22,7 +26,6 @@ def readConfig():
|
|||||||
cfg.read(CONFIG)
|
cfg.read(CONFIG)
|
||||||
|
|
||||||
global host, port, cafile, certfile, keyfile
|
global host, port, cafile, certfile, keyfile
|
||||||
|
|
||||||
host = cfg.get("Client", "host")
|
host = cfg.get("Client", "host")
|
||||||
port = int(cfg.get("Client", "port"))
|
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)
|
print("The server seems to be crazy. Nothing sent.", file=sys.stderr)
|
||||||
|
|
||||||
conn.close()
|
conn.close()
|
||||||
|
quit(exitcode)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
17
dingd
17
dingd
@ -6,6 +6,20 @@
|
|||||||
import ssl, socket, subprocess, time, os, sys
|
import ssl, socket, subprocess, time, os, sys
|
||||||
import configparser
|
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():
|
def getTimestamp():
|
||||||
t = "[" + time.strftime("%Y-%m-%d %H:%M:%S") + "]"
|
t = "[" + time.strftime("%Y-%m-%d %H:%M:%S") + "]"
|
||||||
@ -21,7 +35,6 @@ def execFromConfig(option, pw=False):
|
|||||||
else:
|
else:
|
||||||
return 5
|
return 5
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -39,8 +52,6 @@ def execFromConfig(option, pw=False):
|
|||||||
print(getTimestamp(), "No execution set:", option)
|
print(getTimestamp(), "No execution set:", option)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
while True:
|
while True:
|
||||||
newsocket, fromaddr = bindsocket.accept()
|
newsocket, fromaddr = bindsocket.accept()
|
||||||
|
Loading…
Reference in New Issue
Block a user