mirror of
https://github.com/octoleo/hosts.git
synced 2025-01-06 07:30:42 +00:00
This commit is contained in:
parent
fd58acc7f7
commit
d1edb3dd30
@ -7,7 +7,7 @@ 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
|
if [[ -n $(grep "^$3.*[^A-Za-z0-9\.]$2$" ${path}) ]]; then
|
||||||
echo "Duplicate address/host combination, ${path} unchanged."
|
echo "Duplicate address/host combination, ${path} unchanged."
|
||||||
else
|
else
|
||||||
printf "$3\t$2\n" >> ${path}
|
printf "$3\t$2\n" >> ${path}
|
||||||
|
Loading…
Reference in New Issue
Block a user