This commit is contained in:
spiritlhl 2023-07-02 09:45:09 +00:00
parent 6859c69a01
commit 8dbe4a1db1
3 changed files with 11 additions and 6 deletions

View file

@ -1,5 +1,10 @@
# 更新日志
2023.06.30
- 修复部分机器的网络配置是热加载,写在/run/network/interfaces.d/文件夹下的问题
- 修复安装proxmox-ve时grub-pc配置可能冲突的问题
2023.06.29
- 规整输出,所有输出修改为中英双语

View file

@ -9,14 +9,12 @@
- 创建带IPV6独立地址的VM虚拟机或CT容器
- KVM模板加载部分自定义的限制避免机器用于滥用发包
- 增加arm64架构的一键安装功能
- 文档以及脚本输出修改支持双语
## 更新
2023.06.30
2023.07.02
- 修复部分机器的网络配置是热加载,写在/run/network/interfaces.d/文件夹下的问题
- 修复安装proxmox-ve时grub-pc配置可能冲突的问题
- 修复部分机器的网络配置重复行的部分空格数量不一致导致未识别出重复的问题
[更新日志](CHANGELOG.md)

View file

@ -1,7 +1,7 @@
#!/bin/bash
# from
# https://github.com/spiritLHLS/pve
# 2023.06.30
# 2023.07.02
# cd /root >/dev/null 2>&1
_red() { echo -e "\033[31m\033[01m$@\033[0m"; }
@ -25,9 +25,11 @@ temp_file_apt_fix="/tmp/apt_fix.txt"
remove_duplicate_lines() {
chattr -i "$1"
# 预处理:去除行尾空格和制表符
sed -i 's/[ \t]*$//' "$1"
# 去除重复行并跳过空行和注释行
if [ -f "$1" ]; then
awk '!NF || !seen[$0]++' "$1" > "$1.tmp" && mv -f "$1.tmp" "$1"
awk '{ line = $0; gsub(/^[ \t]+/, "", line); gsub(/[ \t]+/, " ", line); if (!NF || !seen[line]++) print $0 }' "$1" > "$1.tmp" && mv -f "$1.tmp" "$1"
fi
chattr +i "$1"
}