Add CustomAttribut2

main
Sebastian Serfling 2023-10-18 13:10:56 +02:00
parent 47c55ccfdc
commit 5baba9ac08
1 changed files with 16 additions and 16 deletions

View File

@ -125,22 +125,22 @@ def get_local_ip():
service_time = f"23:{str(random.randint(1, 59)).zfill(2)}" ## ADD Random Time
# while True:
# current_time = datetime.now().strftime("%H:%M")
# try:
# with open ("log.txt","a") as datei:
# datei.writelines(request_get("gettime",{}).text + "\n")
# except Exception as e:
# with open ("log.txt","a") as datei:
# datei.writelines(f"{current_time}No Connection to Server!" + "\n")
# if current_time == service_time:
# ip = get_local_ip()
# database = request_post("info/getdatabase",{"ip":ip}).text.replace('"',"")
# adcontroller(ip,database)
# with open ("log.txt","a") as datei:
# datei.writelines(f"{current_time} - Sleep for {22*3600}" + "\n")
# time.sleep(22*3600)
# time.sleep(60)
while True:
current_time = datetime.now().strftime("%H:%M")
try:
with open ("log.txt","a") as datei:
datei.writelines(request_get("gettime",{}).text + "\n")
except Exception as e:
with open ("log.txt","a") as datei:
datei.writelines(f"{current_time}No Connection to Server!" + "\n")
if current_time == service_time:
ip = get_local_ip()
database = request_post("info/getdatabase",{"ip":ip}).text.replace('"',"")
adcontroller(ip,database)
with open ("log.txt","a") as datei:
datei.writelines(f"{current_time} - Sleep for {22*3600}" + "\n")
time.sleep(22*3600)
time.sleep(60)
ip = get_local_ip()
database = request_post("info/getdatabase",{"ip":ip}).text.replace('"',"")