-
Notifications
You must be signed in to change notification settings - Fork 0
/
schedule_daily.fs
executable file
·75 lines (49 loc) · 1.9 KB
/
schedule_daily.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
marker schedule_daily.fs \ Actions at a planned time.
needs Common-extensions.f
needs Sun.f
needs table_sort.f
needs schedule-tool.f
also html
6 value RenewLogDay \ 6=Saturday
27 value RestartServerDay \ On the 27th
: LogToday ( - )
s" *** " upad place (date) +upad s" *** " +upad" +log ;
[DEFINED] ControlWindow [IF] 0 value #changes [THEN]
: Good-morning ( - )
log" Good morning " LogToday &last-line-packet$ count write-log-line
[DEFINED] ControlWindow [IF] 0 to #changes [THEN]
FreeMem" write-log-line
;
: Reset-logging-saturday ( - )
date-now jd week-day RenewLogDay =
if close-log-file logFile" start-logfile
then ;
: Reset-webserver_27th ( - )
date-now 2drop RestartServerDay =
if RestartGforth tid-http-server kill then ;
: Rebuild-arptable ( - ) true to RebuildArpTable- ;
here dup to &options-table \ Options used by run-schedule
\ Map: xt cnt adr-string
' Good-morning dup , >name$ , , \ Executed when the schedule is empty
' Reset-logging-saturday dup , >name$ , ,
' Rebuild-arptable dup , >name$ , ,
' Reset-webserver_27th dup , >name$ , ,
here swap - /option-record / to #option-records
create file-schedule-daily ," schedule-daily.dat"
: Schedule-page ( - )
start-html-page
[ifdef] SitesIndex SitesIndex [then]
s" /home" s" home" <<TopLink>>
+TimeDate/legend
['] add-options-dropdown html-schedule-list ;
TCP/IP DEFINITIONS
' noop alias /NewPage
: /Schedule ( - ) ['] Schedule-page set-page ;
: /Scheduled ( - ) clr-req-buf ['] Schedule-page set-page ;
: SetEntrySchedule ( id hh mm #DropDown - )
SetEntry-schedule /Schedule ;
: AddEntrySchedule ( - ) AddEntry-schedule /Schedule ;
FORTH DEFINITIONS
file-schedule-daily init-schedule start-schedule
previous
\s