virtual router: edithosts.sh cleanup fails on existing hosts

The already deleted same hostname  is not deleted from /etc/hosts of
vRouter.

vRouter's /etc/hosts format:
$ip $host

This patch fixes deletion logic below.
sed -i /"$host "/d $HOSTS

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
Atsushi Midorikawa 2012-12-13 22:59:35 -08:00 committed by Prasanna Santhanam
parent 988ccfc45d
commit 15704cfa6c
1 changed files with 1 additions and 1 deletions

View File

@ -88,7 +88,7 @@ echo "0 $mac $ip $host *" >> $DHCP_LEASES
#edit hosts file as well
sed -i /"$ip "/d $HOSTS
sed -i /"$host "/d $HOSTS
sed -i /" $host$"/d $HOSTS
echo "$ip $host" >> $HOSTS
if [ "$dflt" != "" ]