2022-02-14 16:29:46 -06:00
|
|
|
import time
|
|
|
|
import schedule
|
|
|
|
from LibreQoS import refreshShapers
|
2022-02-25 22:35:41 -06:00
|
|
|
from graphBandwidth import refreshBandwidthGraphs
|
|
|
|
from graphLatency import refreshLatencyGraphs
|
2022-02-26 14:37:47 -06:00
|
|
|
from ispConfig import graphingEnabled, automaticImportUISP
|
|
|
|
from integrationUISP import updateFromUISP
|
2022-02-14 16:29:46 -06:00
|
|
|
|
2022-06-20 04:47:10 -05:00
|
|
|
def importandshape():
|
|
|
|
if automaticImportUISP:
|
|
|
|
updateFromUISP()
|
|
|
|
refreshShapers()
|
2022-02-26 14:37:47 -06:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2022-06-20 04:47:10 -05:00
|
|
|
importandshape()
|
|
|
|
schedule.every().day.at("04:00").do(importandshape)
|
|
|
|
while True:
|
|
|
|
schedule.run_pending()
|
|
|
|
if graphingEnabled:
|
|
|
|
try:
|
|
|
|
refreshBandwidthGraphs()
|
|
|
|
refreshLatencyGraphs(10)
|
|
|
|
except:
|
|
|
|
print("Failed to update graphs")
|
|
|
|
else:
|
|
|
|
time.sleep(60) # wait x seconds
|