From 9dbb28d168d75814f4204123689c13604a3119c9 Mon Sep 17 00:00:00 2001 From: baol Date: Wed, 18 Dec 2024 00:08:47 +0800 Subject: [PATCH] fix bug --- n0.hosts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/n0.hosts.sh b/n0.hosts.sh index 2df1220..d39d0f9 100755 --- a/n0.hosts.sh +++ b/n0.hosts.sh @@ -65,7 +65,7 @@ EOL ) # 检查 /etc/hosts 中是否已经存在这些条目 -if ! grep -Fxq "$HOSTS_CONTENT" /etc/hosts; then +if ! grep -Fxf <(echo "$HOSTS_CONTENT") /etc/hosts > /dev/null; then echo "Adding entries to /etc/hosts..." echo "$HOSTS_CONTENT" | sudo tee -a /etc/hosts > /dev/null echo "Entries added successfully."