diff --git a/arpspoof/Readme.md b/arpspoof/Readme.md index 0f0cc15e6..6d0adabdf 100644 --- a/arpspoof/Readme.md +++ b/arpspoof/Readme.md @@ -17,6 +17,8 @@ _Thanks to everyone having starred my repo! To star it click on the image below, [arpspoof](https://github.com/t0mer/Arpspoof-Docker) adds ability to block internet connection for local network devices This addon is based on the docker image https://hub.docker.com/r/techblog/arpspoof-docker +See all informations here : https://en.techblog.co.il/2021/03/15/home-assistant-cut-internet-connection-using-arpspoof/ + ## Installation The installation of this add-on is pretty straightforward and not different in comparison to installing any other add-on. @@ -37,7 +39,7 @@ Webui can be found at . ```yaml ROUTER_IP: 127.0.0.1 #Required Router IP -INTERFACE_NAME: name #Required Interface name, can use this command to get it: ip route get 8.8.8.8 | sed -nr 's/.*dev ([^\ ]+).*/\1/p' +INTERFACE_NAME: name #Required Interface name. Autofilled if empty. ``` ## Support diff --git a/arpspoof/config.json b/arpspoof/config.json index dbd38e118..fd32f288d 100644 --- a/arpspoof/config.json +++ b/arpspoof/config.json @@ -11,8 +11,7 @@ "host_network": true, "name": "Arpspoof", "options": { - "ROUTER_IP": "yourip", - "INTERFACE_NAME": "interface name" + "ROUTER_IP": "yourip" }, "ports": { "7022/tcp": 7022 @@ -23,7 +22,7 @@ "privileged": ["SYS_ADMIN", "DAC_READ_SEARCH"], "schema": { "ROUTER_IP": "str", - "INTERFACE_NAME": "str" + "INTERFACE_NAME": "str?" }, "slug": "arpspoof", "upstream": "1.0", diff --git a/arpspoof/rootfs/scripts/99-run.sh b/arpspoof/rootfs/scripts/99-run.sh index 58a8ddd23..9011010d1 100644 --- a/arpspoof/rootfs/scripts/99-run.sh +++ b/arpspoof/rootfs/scripts/99-run.sh @@ -1,4 +1,10 @@ #!/usr/bin/env bashio +# Autodefine if not defined +if [ -z INTERFACE_NAME ]; then +INTERFACE_NAME=$(ip route get 8.8.8.8 | sed -nr 's/.*dev ([^\ ]+).*/\1/p') +bashio::log.blue "Autodetection : INTERFACE_NAME=$INTERFACE_NAME" +fi + bashio::log.info "Starting..." -/usr/bin/python3 /opt/arpspoof/arpspoof.py \ No newline at end of file +/usr/bin/python3 /opt/arpspoof/arpspoof.py