mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
cf09542635
Signed-off-by: Christian Hesse <mail@eworm.de>
23 lines
734 B
Text
23 lines
734 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 [ find where name~"daily-psk\\.(capsman|local)" ];
|
|
|
|
/ system scheduler set interval=0s $Scheduler;
|
|
}
|