mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Docs + before_config_save run option
This commit is contained in:
@@ -107,8 +107,7 @@ def main ():
|
||||
|
||||
# TODO fix these
|
||||
loop_start_time = conf.loop_start_time # TODO fix
|
||||
last_update_vendors = conf.last_update_vendors
|
||||
last_network_scan = conf.last_network_scan
|
||||
last_update_vendors = conf.last_update_vendors
|
||||
last_cleanup = conf.last_cleanup
|
||||
last_version_check = conf.last_version_check
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ plugins_once_run = False
|
||||
newVersionAvailable = False
|
||||
time_started = ''
|
||||
startTime = ''
|
||||
last_network_scan = ''
|
||||
last_internet_IP_scan = ''
|
||||
last_scan_run = ''
|
||||
last_cleanup = ''
|
||||
|
||||
@@ -13,7 +13,7 @@ from helper import collect_lang_strings, updateSubnets, initOrSetParam, isJsonOb
|
||||
from logger import mylog
|
||||
from api import update_api
|
||||
from scheduler import schedule_class
|
||||
from plugin import get_plugins_configs, print_plugin_info
|
||||
from plugin import get_plugins_configs, print_plugin_info, run_plugin_scripts
|
||||
|
||||
#===============================================================================
|
||||
# Initialise user defined values
|
||||
@@ -189,8 +189,7 @@ def importConfigs (db):
|
||||
conf.startTime = conf.time_started
|
||||
now_minus_24h = conf.time_started - datetime.timedelta(hours = 24)
|
||||
|
||||
# set these times to the past to force the first run
|
||||
conf.last_network_scan = now_minus_24h
|
||||
# set these times to the past to force the first run
|
||||
conf.last_internet_IP_scan = now_minus_24h
|
||||
conf.last_scan_run = now_minus_24h
|
||||
conf.last_cleanup = now_minus_24h
|
||||
@@ -199,7 +198,6 @@ def importConfigs (db):
|
||||
|
||||
# TODO cleanup later ----------------------------------------------------------------------------------
|
||||
|
||||
# global mySchedules
|
||||
# reset schedules
|
||||
conf.mySchedules = []
|
||||
|
||||
@@ -283,6 +281,9 @@ def importConfigs (db):
|
||||
# update only the settings datasource
|
||||
update_api(db, False, ["settings"])
|
||||
|
||||
# run plugins that are modifying the config
|
||||
run_plugin_scripts(db, 'before_config_save')
|
||||
|
||||
# Used to determine the next import
|
||||
conf.lastTimeImported = time.time()
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@ import const
|
||||
from const import pialertPath, logPath, apiPath
|
||||
from helper import noti_struc, generate_mac_links, removeDuplicateNewLines, timeNowTZ, hide_email, updateState, get_file_content, write_file
|
||||
from logger import logResult, mylog, print_log
|
||||
# from plugin import execute_plugin
|
||||
|
||||
|
||||
from publishers.email import (check_config as email_check_config,
|
||||
send as send_email )
|
||||
|
||||
Reference in New Issue
Block a user