#!/bin/bash
#
# report ip address currently in use by remote control server
#
# for DL3/XL8 this is a static added to bond0 interface
# for DL1/2 this is either dhcp or static on eth1
#

if [ -n "`ip addr | grep inet | grep bond0`" ]; then
    # DL3/XL8 use bonded eth0/1
    NETWORKDEVICE=bond0
else
    # DL1/2 use two separate ports
    NETWORKDEVICE=eth1
fi
ip addr show dev ${NETWORKDEVICE} | grep " inet " | sed 's/[a-z ]*\([0-9./]*\).*$/\1/' | egrep -v "192.168.20.[1-2]" | cat
