From c8747de5032db0c3b86a6ae9ea8a5c188e8354b4 Mon Sep 17 00:00:00 2001 From: master3395 Date: Sun, 15 Feb 2026 03:57:01 +0100 Subject: [PATCH] CI: fix shell syntax (for-loop 2>/dev/null), key-files grep (BRANCH_NAME + cyberpanel_upgrade.sh) --- .github/workflows/ci.yml | 5 +++-- cyberpanel_upgrade.sh | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 695c6667f..df22d57d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,8 @@ jobs: for f in preUpgrade.sh cyberpanel_upgrade.sh plogical/upgrade.py install/install.py plogical/versionFetcher.py; do test -f "$f" || { echo "Missing: $f"; exit 1; } done - grep -q 'download_install_phpmyadmin\|Branch_Name' preUpgrade.sh || exit 1 + grep -q 'BRANCH_NAME' preUpgrade.sh || exit 1 + grep -q 'Branch_Name\|download_install_phpmyadmin\|Branch_Check' cyberpanel_upgrade.sh || exit 1 echo "Key files OK" # Run validation inside a container per supported OS (AlmaLinux, CentOS, CloudLinux, Debian, RHEL, Rocky, Ubuntu). @@ -143,6 +144,6 @@ jobs: for f in preUpgrade.sh cyberpanel_upgrade.sh plogical/upgrade.py install/install.py plogical/versionFetcher.py; do test -f "$f" || { echo "Missing: $f"; exit 1; } done - grep -q "Branch_Name\|download_install_phpmyadmin\|cyberpanel" preUpgrade.sh || exit 1 + grep -q "BRANCH_NAME" preUpgrade.sh && grep -q "Branch_Name\|download_install_phpmyadmin\|Branch_Check" cyberpanel_upgrade.sh || exit 1 echo "Done." ' diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index 3828c4ff4..18d34e324 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -450,7 +450,7 @@ if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "AlmaLinux9" ]] ; then ALMA_VER="${Server_OS_Version:-9}" ARCH="x86_64" ALMA_BASE="https://repo.almalinux.org/almalinux/${ALMA_VER}" - for repo in /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo 2>/dev/null; do + for repo in /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo; do [[ ! -f "$repo" ]] && continue if grep -q '^mirrorlist=' "$repo" 2>/dev/null; then sed -i 's|^mirrorlist=|#mirrorlist=|g' "$repo" @@ -459,7 +459,7 @@ if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "AlmaLinux9" ]] ; then fi done # Ensure appstream/baseos have explicit baseurl; support [appstream], [almalinux-appstream], etc. - for repofile in /etc/yum.repos.d/almalinux.repo /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo 2>/dev/null; do + for repofile in /etc/yum.repos.d/almalinux.repo /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo; do [[ ! -f "$repofile" ]] && continue for section in appstream almalinux-appstream AppStream; do if grep -q "^\[${section}\]" "$repofile" 2>/dev/null; then