diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2023-06-10 22:44:31 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2023-06-10 22:44:31 +0300 |
commit | f3b9d50496257d87757802dfb472b5ffae11962c (patch) | |
tree | 7e77ddaf3a00c467024c41333fcaa99db9da3876 /src/home/util.py | |
parent | 3790c2205396cf860738f297e6ddc49cd2b2a03f (diff) |
new config: port openwrt_log_analyzer
Diffstat (limited to 'src/home/util.py')
-rw-r--r-- | src/home/util.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/home/util.py b/src/home/util.py index 1e12243..11e7116 100644 --- a/src/home/util.py +++ b/src/home/util.py @@ -36,6 +36,14 @@ def validate_ipv4_or_hostname(address: str, raise_exception: bool = False) -> bo return False +def validate_mac_address(mac_address: str) -> bool: + mac_pattern = r'^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$' + if re.match(mac_pattern, mac_address): + return True + else: + return False + + class Addr: host: str port: Optional[int] |