diff options
author | Christian Hesse <mail@eworm.de> | 2022-11-29 17:06:04 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-11-29 17:07:40 +0100 |
commit | 8854d03ea216dbbce38c804d4296feabfb26a978 (patch) | |
tree | 1ceb425d63904a0f492a5a404a04c108dd871706 | |
parent | 0ad94b042de8dac6939f330c2b4270701c5da6d1 (diff) |
global-functions: introduce $IsMacLocallyAdministered...
... and use it in $GetMacVendor.
-rw-r--r-- | global-functions | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/global-functions b/global-functions index aa20e4e..75e9796 100644 --- a/global-functions +++ b/global-functions @@ -35,6 +35,7 @@ :global IsDefaultRouteReachable; :global IsDNSResolving; :global IsFullyConnected; +:global IsMacLocallyAdministered; :global IsTimeSync; :global LogPrintExit2; :global MkDir; @@ -320,9 +321,10 @@ :local Mac [ :tostr $1 ]; :global CertificateAvailable; + :global IsMacLocallyAdministered; :global LogPrintExit2; - :if ([ :tonum ("0x" . [ :pick $Mac 0 [ :find $Mac ":" ] ]) ] & 2 = 2) do={ + :if ([ $IsMacLocallyAdministered $Mac ] = true) do={ :return "locally administered"; } @@ -427,6 +429,14 @@ :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 :set IsTimeSync do={ :global IsTimeSyncCached; |