mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Make nmap work in Docker
This commit is contained in:
parent
78826648e3
commit
b41706efe3
@ -5,6 +5,12 @@ VOLUME /config
|
|||||||
|
|
||||||
RUN pip3 install --no-cache-dir -r requirements_all.txt
|
RUN pip3 install --no-cache-dir -r requirements_all.txt
|
||||||
|
|
||||||
|
# For the nmap tracker
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends nmap net-tools && \
|
||||||
|
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
|
# Open Z-Wave disabled because broken
|
||||||
#RUN apt-get update && \
|
#RUN apt-get update && \
|
||||||
# apt-get install -y cython3 libudev-dev && \
|
# apt-get install -y cython3 libudev-dev && \
|
||||||
# apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
|
# apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
|
||||||
|
@ -137,9 +137,7 @@ class NmapDeviceScanner(object):
|
|||||||
continue
|
continue
|
||||||
name = info['hostnames'][0] if info['hostnames'] else ipv4
|
name = info['hostnames'][0] if info['hostnames'] else ipv4
|
||||||
# Mac address only returned if nmap ran as root
|
# Mac address only returned if nmap ran as root
|
||||||
mac = info['addresses'].get('mac')
|
mac = info['addresses'].get('mac') or _arp(ipv4)
|
||||||
if mac is None:
|
|
||||||
mac = _arp(ipv4)
|
|
||||||
if mac is None:
|
if mac is None:
|
||||||
continue
|
continue
|
||||||
device = Device(mac.upper(), name, ipv4, now)
|
device = Device(mac.upper(), name, ipv4, now)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user