From 50a2f1522ef6284d2d2badc5e70969a0d41c6517 Mon Sep 17 00:00:00 2001 From: Gurkirat Singh Date: Sat, 8 Jun 2019 03:14:37 +0530 Subject: [PATCH] minor bug fix --- plugins/available/hosts.plugin.bash | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/available/hosts.plugin.bash b/plugins/available/hosts.plugin.bash index ea3195c2..3977ddad 100755 --- a/plugins/available/hosts.plugin.bash +++ b/plugins/available/hosts.plugin.bash @@ -6,13 +6,13 @@ about-plugin '/etc/hosts based operations' ___HOST_FILE="/etc/hosts" function ___hosts_add { - local ENTRY=`grep "$2" $_HOST_FILE` + local ENTRY=`grep "$2" $___HOST_FILE` if [[ $ENTRY != "" ]] then echo "Host "$2" already added" echo $ENTRY else - echo "$1 $2" | sudo tee -a /etc/hosts > /dev/null + echo "$1 $2" | sudo tee -a $___HOST_FILE > /dev/null echo "Added $1 $2 to hosts file" exit 1 fi @@ -23,11 +23,11 @@ function ___hosts_list { } function ___hosts_remove { - local ENTRY=`grep "$1" $_HOST_FILE` + local ENTRY=`grep "$1" $___HOST_FILE` if [[ $ENTRY != "" ]] then - DELETED=`grep -w -v $1 $_HOST_FILE` - echo "$DELETED" | sudo tee /etc/hosts > /dev/null + DELETED=`grep -w -v $1 $___HOST_FILE` + echo "$DELETED" | sudo tee $___HOST_FILE > /dev/null echo "Removed \""$ENTRY"\" from hosts file" else echo "Host "$1" not found"