mirror of
https://github.com/octoleo/hosts.git
synced 2024-11-29 00:06:38 +00:00
This commit is contained in:
parent
b1aff730b9
commit
fd58acc7f7
@ -7,7 +7,11 @@ remusage="Usage: `basename $0` -remove host"
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
-add)
|
-add)
|
||||||
if [ $# -eq 3 ]; then
|
if [ $# -eq 3 ]; then
|
||||||
|
if [[ -n $(grep "^$3.*[^A-Za-z0-9\.]$2$" hosts) ]]; then
|
||||||
|
echo "Duplicate address/host combination, ${path} unchanged."
|
||||||
|
else
|
||||||
printf "$3\t$2\n" >> ${path}
|
printf "$3\t$2\n" >> ${path}
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo $addusage;
|
echo $addusage;
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user