fi
}
-ConfigNetwork () {
+ConfigNetwork () { ### for NON LVS servers.
# PRIMARY_IF=$(ip route get 8.8.8.8 | awk '{print $5; exit}') #TODO remove this as its declared above in the GetNics Function - done
-if [ ! -z "$PRIMARY_INTERFACE" ]; then #TODO update variable - done
- sed -i "s/Primary_IF/$PRIMARY_INTERFACE/g" /etc/network/interfaces #TODO update variable - done
+if [ ! -z "${SECOND_PHYSICAL_INTERFACE}" ]
+then
+ PRIMARY_INTERFACE="${SECOND_PHYSICAL_INTERFACE}"
+fi
+
+if [ ! -z "$PRIMARY_INTERFACE" ]; #TODO update variable - done
+then
+ sed -i "s/Primary_IF/$PRIMARY_INTERFACE/g" /etc/network/interfaces #TODO update variable - done
else
- echo "ERROR: Unable to set primary interface. You must edit /etc/network/interfaces manually."
+ echo "ERROR: Unable to set primary interface. You must edit /etc/network/interfaces manually."
fi
#TODO expand this function to handle all interfaces anywhere. aw-4/4/2019
}
+
### Setup monitoring.
SetupMonitoring () {
## Monitored hosts
GetNics ### Get the network interface #TODO change function called here from GetNic to GetNics - done
+
### Temporary create and alias interface for installation
+GetNics
+if [ ! -z "${SECOND_PHYSICAL_INTERFACE}" ]
+then
+ PRIMARY_INTERFACE="${SECOND_PHYSICAL_INTERFACE}"
+fi
ip a add Priv_IP/My_CIDR dev $PRIMARY_INTERFACE label ${PRIMARY_INTERFACE}:0 #TODO update Variable to $3PRIMARY_INTERFACE - done
+ip link set $PRIMARY_INTERFACE up
### Install Opensrf and Evergreen debs.
if [ -e debconf-settings ]