diff --git a/extra_scripts/ifupdown2-install.service b/extra_scripts/ifupdown2-install.service new file mode 100644 index 0000000..7b8690d --- /dev/null +++ b/extra_scripts/ifupdown2-install.service @@ -0,0 +1,12 @@ +[Unit] +Description=Install ifupdown2 on next reboot +After=network.target + +[Service] +Type=oneshot +ExecStart=/root/install_ifupdown2.sh +ExecStartPost=/sbin/reboot +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/extra_scripts/install_ifupdown2.sh b/extra_scripts/install_ifupdown2.sh new file mode 100644 index 0000000..05492c5 --- /dev/null +++ b/extra_scripts/install_ifupdown2.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# from +# https://github.com/spiritLHLS/pve +# 2023.06.25 + +# 安装ifupdown2 +apt-get update +apt-get install -y ifupdown2 + +# 删除Systemd服务 +systemctl disable ifupdown2-install.service +rm /etc/systemd/system/ifupdown2-install.service + +# 删除自身 +rm $0 diff --git a/scripts/install_pve.sh b/scripts/install_pve.sh index 3532d25..dc3dbdd 100644 --- a/scripts/install_pve.sh +++ b/scripts/install_pve.sh @@ -3,7 +3,7 @@ # https://github.com/spiritLHLS/pve # 2023.06.25 - +cd /root >/dev/null 2>&1 _red() { echo -e "\033[31m\033[01m$@\033[0m"; } _green() { echo -e "\033[32m\033[01m$@\033[0m"; } _yellow() { echo -e "\033[33m\033[01m$@\033[0m"; }