From e7aa51523573beec264a4821cea01d16938f158b Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Mon, 26 Jun 2023 01:17:02 +0000 Subject: [PATCH] Update --- scripts/build_nat_network.sh | 14 +++++++++++++- scripts/install_pve.sh | 11 ++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/scripts/build_nat_network.sh b/scripts/build_nat_network.sh index 9768d55..d527409 100644 --- a/scripts/build_nat_network.sh +++ b/scripts/build_nat_network.sh @@ -116,6 +116,18 @@ iface vmbr0 inet static bridge_stp off bridge_fd 0 EOF +elif [ -f "/root/iface_auto.txt" ]; then +cat << EOF | sudo tee -a "$interfaces_file" +auto vmbr0 +iface vmbr0 inet static + address $ipv4_address + gateway $gateway + bridge_ports $interface + bridge_stp off + bridge_fd 0 + +iface eth0 inet6 auto +EOF else cat << EOF | sudo tee -a "$interfaces_file" auto vmbr0 @@ -162,7 +174,7 @@ if grep -q "^net.ipv4.ip_forward=1" /etc/sysctl.conf; then sed -i 's/^#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf fi else - echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf + echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf fi ${sysctl_path} -p diff --git a/scripts/install_pve.sh b/scripts/install_pve.sh index 2db989b..53df035 100644 --- a/scripts/install_pve.sh +++ b/scripts/install_pve.sh @@ -1,7 +1,7 @@ #!/bin/bash # from # https://github.com/spiritLHLS/pve -# 2023.06.25 +# 2023.06.26 cd /root >/dev/null 2>&1 _red() { echo -e "\033[31m\033[01m$@\033[0m"; } @@ -168,14 +168,7 @@ do if [ -n "$matches" ]; then # SLAAC动态分配,做无IPV6的处理 sed -i "/iface $interface inet6 auto/d" $1 - # cdn_urls=("https://cdn.spiritlhl.workers.dev/" "https://cdn3.spiritlhl.net/" "https://cdn1.spiritlhl.net/" "https://ghproxy.com/" "https://cdn2.spiritlhl.net/") - # check_cdn_file - # wget ${cdn_success_url}https://raw.githubusercontent.com/spiritLHLS/pve/main/extra_scripts/configure_network.sh -O /usr/local/bin/configure_network.sh - # wget ${cdn_success_url}https://raw.githubusercontent.com/spiritLHLS/pve/main/extra_scripts/configure_network.service -O /etc/systemd/system/configure_network.service - # chmod 777 /usr/local/bin/configure_network.sh - # chmod 777 /etc/systemd/system/configure_network.service - # systemctl daemon-reload - # systemctl enable configure_network.service + echo "$interface" > "/root/iface_auto.txt" else # 将 "auto" 替换为 "static" modified_line="${line/auto/static}"