PIHOLE to plugin rewrite

This commit is contained in:
Jokob-sk
2023-08-09 07:52:56 +10:00
parent bae7b0400c
commit 0e23c6ac61
17 changed files with 130 additions and 241 deletions

View File

@@ -200,39 +200,9 @@ def main ():
if run:
nmapSchedule.last_run = timeNowTZ()
performNmapScan(db, get_all_devices(db))
# todo replace the scans with plugins
# Perform a network scan via arp-scan or pihole
# if last_network_scan + datetime.timedelta(minutes=conf.SCAN_CYCLE_MINUTES) < loop_start_time:
# last_network_scan = loop_start_time
# conf.cycle = 1 # network scan
# mylog('verbose', ['[MAIN] cycle:',conf.cycle])
# updateState(db,"Scan: Network")
# # scan_network()
# # DEBUG start ++++++++++++++++++++++++++++++++++++++++++++++++++++++
# # Start scan_network as a process
# p = multiprocessing.Process(target=scan_network(db))
# p.start()
# # Wait for a maximum of 3600 seconds (1h) or until process finishes
# p.join(3600)
# # If thread is still active
# if p.is_alive():
# mylog('none', "[MAIN] scan_network running too long - let\'s kill it")
# # Terminate - may not work if process is stuck for good
# p.terminate()
# # OR Kill - will work for sure, no chance for process to finish nicely however
# # p.kill()
# p.join()
# # DEBUG end ++++++++++++++++++++++++++++++++++++++++++++++++++++++
# # Run splugin scripts which are set to run every timne after a scan finished
# Run splugin scripts which are set to run every timne after a scans finished
if conf.ENABLE_PLUGINS:
run_plugin_scripts(db,'always_after_scan')