#!/bin/sh
###############################################################################
#
#                    S H E L L   S C R I P T  F I L E  
#
#                     COPYRIGHT 2011 MOTOROLA
#                       ALL RIGHTS RESERVED
#
###############################################################################
#
#   FILE NAME       : configure_edit_net_config
#   FUNCTION        : 
#   PARAMETERS      : None 
###############################################################################
#
# Revision History:
#
# Date      Name          Prob#        Description
# --------  ------------  -----        ----------------------------------------
# 08/03/11 MotorolaID                 Initial version.
#
###############################################################################


#####################################################
# Start of main functionallity in the script 
#####################################################

LOGGING_INFO="user.info"
LOGGING_ERROR="user.error"
MY_IP=

FAILURE=1
SUCCESS=0

#/etc/opt/Motorola/aaa/uae_menu_drv/ifcfg-eth0_config

cmd_output=`/usr/sbin/edit-net-config`
if [ $? != $SUCCESS ]; then
	logger -s -p $LOGGING_ERROR -t `basename $0` "Error executing edit-net-config"
	logger -s -p $LOGGING_ERROR -t `basename $0` "$cmd_output"
	exit $FAILURE
fi

# set the IP address into the omc_server_sites table
MY_IP=$(ifconfig eth0 | grep inet | awk '{print $2}' | awk '{print substr($$0,6,16)}')

/opt/Motorola/mcd5000/omcserver/scripts/Configure_scripts/files/confige_myCNF ${MY_IP}
/opt/Motorola/mcd5000/omcserver/bin/omc_ipds_config setip -pip ${MY_IP}

echo "Please reboot the server!"


exit $SUCCESS

#####################################################
# End of main functionallity in the script
#####################################################
