5 _IP=`getent hosts ${_SRC_HOST}|cut -d' ' -f1`
7 echo "Cannot retreive IP for host mapping ${_SRC_HOST} -> ${_DST_HOST}"
10 _REGEX=".*[[:blank:]]${_DST_HOST}$"
11 if grep -c -e "${_REGEX}" /etc/hosts > /dev/null 2>&1 ; then
12 cp /etc/hosts /tmp/hosts
13 sed -i "s/${_REGEX}/${_IP} ${_DST_HOST}/g" /tmp/hosts
14 cp /tmp/hosts /etc/hosts
16 echo "${_IP} ${_DST_HOST}" >> /etc/hosts