mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-07-10 01:54:31 +02:00
global-functions: introduce $IsMacLocallyAdministered...
... and use it in $GetMacVendor.
This commit is contained in:
parent
0ad94b042d
commit
8854d03ea2
1 changed files with 11 additions and 1 deletions
|
@ -35,6 +35,7 @@
|
||||||
:global IsDefaultRouteReachable;
|
:global IsDefaultRouteReachable;
|
||||||
:global IsDNSResolving;
|
:global IsDNSResolving;
|
||||||
:global IsFullyConnected;
|
:global IsFullyConnected;
|
||||||
|
:global IsMacLocallyAdministered;
|
||||||
:global IsTimeSync;
|
:global IsTimeSync;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
:global MkDir;
|
:global MkDir;
|
||||||
|
@ -320,9 +321,10 @@
|
||||||
:local Mac [ :tostr $1 ];
|
:local Mac [ :tostr $1 ];
|
||||||
|
|
||||||
:global CertificateAvailable;
|
:global CertificateAvailable;
|
||||||
|
:global IsMacLocallyAdministered;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
|
|
||||||
:if ([ :tonum ("0x" . [ :pick $Mac 0 [ :find $Mac ":" ] ]) ] & 2 = 2) do={
|
:if ([ $IsMacLocallyAdministered $Mac ] = true) do={
|
||||||
:return "locally administered";
|
:return "locally administered";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,6 +429,14 @@
|
||||||
:return true;
|
:return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# check if mac address is locally administered
|
||||||
|
:set IsMacLocallyAdministered do={
|
||||||
|
:if ([ :tonum ("0x" . [ :pick $1 0 [ :find $1 ":" ] ]) ] & 2 = 2) do={
|
||||||
|
:return true;
|
||||||
|
}
|
||||||
|
:return false;
|
||||||
|
}
|
||||||
|
|
||||||
# check if system time is sync
|
# check if system time is sync
|
||||||
:set IsTimeSync do={
|
:set IsTimeSync do={
|
||||||
:global IsTimeSyncCached;
|
:global IsTimeSyncCached;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue