if [ "$1" = "" ]; then
	echo "Usage: ./setIPEx <file> <line to add>"
	exit
fi

if [ "$2" = "" ]; then
	echo "Usage: ./setIPEx <file> <line to add>"
	exit
fi

param=`grep "^[0123456789. ]*:.*" $1`



if [ "$param" = "" ]; then
	echo "Param not present";
	echo "Appending..."
	echo "$2" >> $1 
else
	echo "Param already present";
	echo "Replacing.."
	echo "/^[0123456789. ]*:.*/ c $2" > /tmp/cmd_2 
	sed -i -f /tmp/cmd_2 $1 
	rm -f /tmp/cmd_2
fi
