routeros-scripts/daily-psk-schedule
Christian Hesse 93a6bff312 daily-psk-schedule: give time in short format
Note that a unit is required to make it a time value!
2019-01-03 10:23:02 +01:00

23 lines
693 B
Text

#!rsc
# RouterOS script: daily-psk-schedule
# Copyright (c) 2013-2019 Christian Hesse <mail@eworm.de>
#
# schedule daily-psk on startup
:local scheduler [ / system scheduler find where name=daily-psk-schedule ];
:if ([ / system scheduler get $scheduler interval ] = 0s) do={
/ system scheduler set interval=15s $scheduler;
} else={
:if ([ / tool netwatch get [ find where comment=[ / tool e-mail get address ] ] status ] != "up" ) do={
:error "Mail server is not up.";
}
:if ([ / system ntp client get status ] != "synchronized") do={
:error "Time is not yet synchronized from ntp.";
}
/ system script run daily-psk;
/ system scheduler set interval=0s $scheduler;
}