From 96b077f20261127233f76f41ed18f2800b8de804 Mon Sep 17 00:00:00 2001 From: MeaTLoTioN Date: Thu, 10 Apr 2025 15:11:30 +0100 Subject: [PATCH] update --- scripts/wfc.mpy | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/scripts/wfc.mpy b/scripts/wfc.mpy index 1816651..854b5bb 100644 --- a/scripts/wfc.mpy +++ b/scripts/wfc.mpy @@ -1,6 +1,7 @@ from mystic_bbs import * from datetime import datetime import os, subprocess +from time import sleep now = datetime.now() TEXT = str(getcfg()['text']) @@ -9,6 +10,7 @@ CFG = str(getcfg()) USER = str(getuser()) HANDLE = str(getuser()['handle']) + def dispHeader(): A = mci2str('AV') V = mci2str('IL') @@ -52,7 +54,7 @@ def dispQuickLog(log="mis"): LOGDIR = "/mystic/logs" if log.lower() == "mis": - logFile = 'grep -vE "HTTP|BINKP|HostName|Blocked|Connect|EVENT" `ls -1hrt '+LOGDIR+'/mis.*.log|tail -1`|tail -n5|head -n4|cut -c -76' + logFile = 'grep -avE "HTTP|BINKP|HostName|Blocked|Connect|EVENT" `ls -1hrt '+LOGDIR+'/mis.*.log|tail -1`|tail -n5|head -n4|cut -c -76' logFileStatus = ' |14MIS.LOG|07 ' elif log.lower() == "mutil": logFile = 'tail -n4 '+LOGDIR+'/mutil.latest.log|cut -c -76' @@ -65,7 +67,7 @@ def dispQuickLog(log="mis"): SY = 19 OS = 0 - lines = os.popen('grep -vE "HTTP|BINKP|HostName|Blocked|Connect|EVENT" `ls -1hrt '+LOGDIR+'/mis.*.log|tail -1`|tail -n5|head -n4|cut -c -76').readlines() + lines = os.popen('grep -avE "HTTP|BINKP|HostName|Blocked|Connect|EVENT" `ls -1hrt '+LOGDIR+'/mis.*.log|tail -1`|tail -n5|head -n4|cut -c -76').readlines() lines = os.popen(logFile).readlines() lines = map(lambda s: s.strip(), lines) for line in lines: @@ -81,4 +83,22 @@ def init(): dispQuickLog('mis') init() + +def main(): + timer = 0 + finished = False + + while not finished: + dispHeader() + dispTotals() + dispSysInfo() + dispQuickLog('mis') + sleep(5); + timer = timer + 1 + if timer > 5: + finished = True + +if __name__ == "__main__": + main() + gotoxy(1,24); writeln("|PA")