CI: fix shell syntax (for-loop 2>/dev/null), key-files grep (BRANCH_NAME + cyberpanel_upgrade.sh)

This commit is contained in:
master3395
2026-02-15 03:57:01 +01:00
parent e97365baee
commit c8747de503
2 changed files with 5 additions and 4 deletions

View File

@@ -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."
'

View File

@@ -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