mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
daily-psk: wait to be fully connected
This commit is contained in:
@@ -15,8 +15,9 @@
|
|||||||
:global SendNotification;
|
:global SendNotification;
|
||||||
:global UrlEncode;
|
:global UrlEncode;
|
||||||
:global WaitForFile;
|
:global WaitForFile;
|
||||||
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
:local Seen [ :toarray "" ];
|
$WaitFullyConnected;
|
||||||
|
|
||||||
# return pseudo-random string for PSK
|
# return pseudo-random string for PSK
|
||||||
:local GeneratePSK do={
|
:local GeneratePSK do={
|
||||||
@@ -48,6 +49,7 @@
|
|||||||
($DailyPskSecrets->2->$WeekDay));
|
($DailyPskSecrets->2->$WeekDay));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:local Seen [ :toarray "" ];
|
||||||
:local Date [ / system clock get date ];
|
:local Date [ / system clock get date ];
|
||||||
:local NewPsk [ $GeneratePSK $Date ];
|
:local NewPsk [ $GeneratePSK $Date ];
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,9 @@
|
|||||||
:global SendNotification;
|
:global SendNotification;
|
||||||
:global UrlEncode;
|
:global UrlEncode;
|
||||||
:global WaitForFile;
|
:global WaitForFile;
|
||||||
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
:local Seen [ :toarray "" ];
|
$WaitFullyConnected;
|
||||||
|
|
||||||
# return pseudo-random string for PSK
|
# return pseudo-random string for PSK
|
||||||
:local GeneratePSK do={
|
:local GeneratePSK do={
|
||||||
@@ -48,6 +49,7 @@
|
|||||||
($DailyPskSecrets->2->$WeekDay));
|
($DailyPskSecrets->2->$WeekDay));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:local Seen [ :toarray "" ];
|
||||||
:local Date [ / system clock get date ];
|
:local Date [ / system clock get date ];
|
||||||
:local NewPsk [ $GeneratePSK $Date ];
|
:local NewPsk [ $GeneratePSK $Date ];
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,9 @@
|
|||||||
:global SendNotification;
|
:global SendNotification;
|
||||||
:global UrlEncode;
|
:global UrlEncode;
|
||||||
:global WaitForFile;
|
:global WaitForFile;
|
||||||
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
:local Seen [ :toarray "" ];
|
$WaitFullyConnected;
|
||||||
|
|
||||||
# return pseudo-random string for PSK
|
# return pseudo-random string for PSK
|
||||||
:local GeneratePSK do={
|
:local GeneratePSK do={
|
||||||
@@ -49,6 +50,7 @@
|
|||||||
($DailyPskSecrets->2->$WeekDay));
|
($DailyPskSecrets->2->$WeekDay));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:local Seen [ :toarray "" ];
|
||||||
:local Date [ / system clock get date ];
|
:local Date [ / system clock get date ];
|
||||||
:local NewPsk [ $GeneratePSK $Date ];
|
:local NewPsk [ $GeneratePSK $Date ];
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ For local interface:
|
|||||||
And add schedulers to run the script:
|
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 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.
|
These will update the passphrase on boot and nightly at 3:00.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user