mirror of
https://github.com/thelittlerocket/pve.git
synced 2025-01-31 18:18:28 +08:00
update
This commit is contained in:
parent
4666ea0014
commit
4332baec6f
1 changed files with 2 additions and 2 deletions
|
@ -25,14 +25,14 @@ temp_file_apt_fix="/tmp/apt_fix.txt"
|
|||
|
||||
remove_duplicate_lines() {
|
||||
chattr -i "$1"
|
||||
# 去除重复行并跳过空行和注释行
|
||||
if [ -f "$1" ]; then
|
||||
awk '!/^( *#|$)/ { if (!x[$0]++) print }' "$1" > "$1.tmp" && mv -f "$1.tmp" "$1"
|
||||
awk 'NF && !/^( *#|$)/ { if (!x[$0]++) print; next } { print }' "$1" > "$1.tmp" && mv -f "$1.tmp" "$1"
|
||||
fi
|
||||
rm -rf "$1.tmp"
|
||||
chattr +i "$1"
|
||||
}
|
||||
|
||||
|
||||
install_package() {
|
||||
package_name=$1
|
||||
if command -v $package_name > /dev/null 2>&1 ; then
|
||||
|
|
Loading…
Reference in a new issue