1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-19 14:48:13 +00:00

Merge pull request #1119 from pi-hole/tweak/dry_installer

Repetitive `ip route get` was resetting counts.
This commit is contained in:
Dan Schaper 2017-01-08 20:43:40 -08:00 committed by GitHub
commit 642a73508d

View File

@ -168,10 +168,13 @@ getGitFiles() {
} }
find_IPv4_information() { find_IPv4_information() {
local route
# Find IP used to route to outside world # Find IP used to route to outside world
IPv4dev=$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}') route=$(ip route get 8.8.8.8)
IPV4_ADDRESS=$(ip route get 8.8.8.8| awk '{print $7}') IPv4dev=$(awk '{for (i=1; i<=NF; i++) if ($i~/dev/) print $(i+1)}' <<< "${route}")
IPv4gw=$(ip route get 8.8.8.8 | awk '{print $3}') IPV4_ADDRESS=$(awk '{print $7}' <<< "${route}")
IPv4gw=$(awk '{print $3}' <<< "${route}")
} }
get_available_interfaces() { get_available_interfaces() {