Fix IP Calculation

This commit is contained in:
Mike Reeves
2020-03-10 15:56:05 -04:00
parent 4ca2f3eafd
commit f74bc4cfa0

View File

@@ -611,7 +611,14 @@ get_filesystem_root(){
get_main_ip() { get_main_ip() {
# Get the main IP address the box is using # Get the main IP address the box is using
# Add some logic because Bubntu 18.04 like to be different
if [ $OSVER == 'bionic' ]; then
MAINIP=$(ip route get 1 | awk '{print $7;exit}')
else
MAINIP=$(ip route get 1 | awk '{print $NF;exit}') MAINIP=$(ip route get 1 | awk '{print $NF;exit}')
fi
MAININT=$(ip route get 1 | awk '{print $5;exit}') MAININT=$(ip route get 1 | awk '{print $5;exit}')
} }