1
0
mirror of https://github.com/pi-hole/docker-pi-hole.git synced 2024-06-29 12:41:00 +02:00

generic iproute output parsing

Fixes #346
Fixes #312
This commit is contained in:
Adam Hill 2018-10-31 20:11:18 -05:00 committed by GitHub
parent 4907bc533d
commit 497ae17bf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Lookups may not work for VPN / tun0 # Lookups may not work for VPN / tun0
IP_LOOKUP="$(ip route get 8.8.8.8 | awk '{ print $NF; exit }')" IP_LOOKUP="$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}')"
IPv6_LOOKUP="$(ip -6 route get 2001:4860:4860::8888 | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}')" IPv6_LOOKUP="$(ip -6 route get 2001:4860:4860::8888 | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}')"
# Just hard code these to your docker server's LAN IP if lookups aren't working # Just hard code these to your docker server's LAN IP if lookups aren't working