#!/bin/bash
IP=`ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
ampwebip=`cat /etc/amportal.conf | grep AMPWEBADDRESS=` 
ampwebip=${ampwebip#AMPWEBADDRESS=*}

if [ ${IP} != ${ampwebip} ]; then 
  #Set ampwebaddress
  sed -i "s/\(^AMPWEBADDRESS=\).*/\1$IP/" /etc/amportal.conf 
fi

