From 99234fcaa366b9f1a643eb5460ca7e64f37c7dbb Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Wed, 14 Jun 2023 09:10:10 +0800 Subject: [PATCH] Update build_nat_network.sh --- scripts/build_nat_network.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/build_nat_network.sh b/scripts/build_nat_network.sh index 1d5a44c..c430d23 100644 --- a/scripts/build_nat_network.sh +++ b/scripts/build_nat_network.sh @@ -1,6 +1,6 @@ #!/bin/bash #from https://github.com/spiritLHLS/pve -# 2023.06.12 +# 2023.06.13 # 打印信息 _red() { echo -e "\033[31m\033[01m$@\033[0m"; } @@ -54,12 +54,12 @@ if [ -f /etc/network/interfaces ]; then fi interfaces_file="/etc/network/interfaces" chattr -i "$interfaces_file" -# if ! grep -q "auto lo" "$interfaces_file"; then -# echo "auto lo" >> "$interfaces_file" -# fi -# if ! grep -q "iface lo inet loopback" "$interfaces_file"; then -# echo "iface lo inet loopback" >> "$interfaces_file" -# fi +if ! grep -q "auto lo" "$interfaces_file"; then + echo "auto lo" >> "$interfaces_file" +fi +if ! grep -q "iface lo inet loopback" "$interfaces_file"; then + echo "iface lo inet loopback" >> "$interfaces_file" +fi if ! grep -q "iface ${interface} inet manual" "$interfaces_file"; then echo "iface ${interface} inet manual" >> "$interfaces_file" fi