From 8f10647ec1bb4f09ffca00e315fb250ef60306de Mon Sep 17 00:00:00 2001
From: wtgtybhertgeghgtwtg <wtgtybhertgeghgtwtg@gmail.com>
Date: Wed, 17 Apr 2019 03:57:53 -0600
Subject: [PATCH] fix: get public IP from default interface (#1396)

---
 install.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/install.sh b/install.sh
index 248f378..ed385e7 100644
--- a/install.sh
+++ b/install.sh
@@ -50,7 +50,7 @@ getAlgo() {
 publicIpFromInterface() {
   echo "Couldn't find a valid ipv4 address, using the first IP found on the interfaces as the endpoint."
   DEFAULT_INTERFACE="$(ip -4 route list match default | grep -Eo "dev .*" | awk '{print $2}')"
-  ENDPOINT=$(ip -4 addr sh dev eth0 | grep -w inet | head -n1 | awk '{print $2}' | grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b')
+  ENDPOINT=$(ip -4 addr sh dev $DEFAULT_INTERFACE | grep -w inet | head -n1 | awk '{print $2}' | grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b')
   export ENDPOINT=$ENDPOINT
   echo "Using ${ENDPOINT} as the endpoint"
 }