mirror of
https://github.com/rejetto/hfs2.git
synced 2025-12-19 10:03:56 +01:00
new 'init' section for events file, executed at each reload
This commit is contained in:
parent
07f5f2ca6b
commit
65d4a142e4
11
main.pas
11
main.pas
@ -1,4 +1,4 @@
|
||||
{
|
||||
{
|
||||
Copyright (C) 2002-2020 Massimo Melina (www.rejetto.com)
|
||||
|
||||
This file is part of HFS ~ HTTP File Server.
|
||||
@ -7867,7 +7867,12 @@ finally freeAndNIL(info) end;
|
||||
end; // autoCheckUpdates
|
||||
|
||||
procedure loadEvents();
|
||||
begin eventScripts.fullText:=loadTextFile(cfgpath+EVENTSCRIPTS_FILE) end;
|
||||
begin
|
||||
if not newMtime(cfgpath+EVENTSCRIPTS_FILE, eventScriptsLast) then
|
||||
exit;
|
||||
eventScripts.fullText:=loadTextFile(cfgpath+EVENTSCRIPTS_FILE);
|
||||
runEventScript('init');
|
||||
end;
|
||||
|
||||
procedure Tmainfrm.updateCopyBtn();
|
||||
resourcestring
|
||||
@ -8124,8 +8129,6 @@ var
|
||||
updateCopyBtn();
|
||||
keepTplUpdated();
|
||||
updateCurrentCFG();
|
||||
|
||||
if newMtime(cfgpath+EVENTSCRIPTS_FILE, eventScriptsLast) then
|
||||
loadEvents();
|
||||
|
||||
if assigned(runScriptFrm) and runScriptFrm.visible
|
||||
|
||||
Loading…
Reference in New Issue
Block a user