mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
daily-psk: wait to be fully connected
This commit is contained in:
parent
7ecda2204f
commit
7597911672
4 changed files with 10 additions and 4 deletions
|
@ -15,8 +15,9 @@
|
|||
:global SendNotification;
|
||||
:global UrlEncode;
|
||||
:global WaitForFile;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
:local Seen [ :toarray "" ];
|
||||
$WaitFullyConnected;
|
||||
|
||||
# return pseudo-random string for PSK
|
||||
:local GeneratePSK do={
|
||||
|
@ -48,6 +49,7 @@
|
|||
($DailyPskSecrets->2->$WeekDay));
|
||||
}
|
||||
|
||||
:local Seen [ :toarray "" ];
|
||||
:local Date [ / system clock get date ];
|
||||
:local NewPsk [ $GeneratePSK $Date ];
|
||||
|
||||
|
|
|
@ -15,8 +15,9 @@
|
|||
:global SendNotification;
|
||||
:global UrlEncode;
|
||||
:global WaitForFile;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
:local Seen [ :toarray "" ];
|
||||
$WaitFullyConnected;
|
||||
|
||||
# return pseudo-random string for PSK
|
||||
:local GeneratePSK do={
|
||||
|
@ -48,6 +49,7 @@
|
|||
($DailyPskSecrets->2->$WeekDay));
|
||||
}
|
||||
|
||||
:local Seen [ :toarray "" ];
|
||||
:local Date [ / system clock get date ];
|
||||
:local NewPsk [ $GeneratePSK $Date ];
|
||||
|
||||
|
|
|
@ -16,8 +16,9 @@
|
|||
:global SendNotification;
|
||||
:global UrlEncode;
|
||||
:global WaitForFile;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
:local Seen [ :toarray "" ];
|
||||
$WaitFullyConnected;
|
||||
|
||||
# return pseudo-random string for PSK
|
||||
:local GeneratePSK do={
|
||||
|
@ -49,6 +50,7 @@
|
|||
($DailyPskSecrets->2->$WeekDay));
|
||||
}
|
||||
|
||||
:local Seen [ :toarray "" ];
|
||||
:local Date [ / system clock get date ];
|
||||
:local NewPsk [ $GeneratePSK $Date ];
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ For local interface:
|
|||
And add schedulers to run the script:
|
||||
|
||||
/ system scheduler add interval=1d name=daily-psk-nightly on-event="/ system script run daily-psk.local;" start-date=may/23/2018 start-time=03:00:00;
|
||||
/ system scheduler add name=daily-psk-startup on-event=":global WaitFullyConnected; / system script { run global-wait; \$WaitFullyConnected; run daily-psk.local; }" start-time=startup;
|
||||
/ system scheduler add name=daily-psk-startup on-event="/ system script { run global-wait; run daily-psk.local; }" start-time=startup;
|
||||
|
||||
These will update the passphrase on boot and nightly at 3:00.
|
||||
|
||||
|
|
Loading…
Reference in a new issue