From 6a608522d7993a5e80b2ab25b812c1ebf117a7a1 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 09:06:42 -0500 Subject: [PATCH 1/9] fix(shellcheck): quote qdisc parameter expansion to satisfy SC2295 --- .github/scripts/verify-site-scripts.sh | 17 +++++++++++++---- .../tools_scripts/fasterdata-tuning.sh | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/scripts/verify-site-scripts.sh b/.github/scripts/verify-site-scripts.sh index ddf26295..bd1a0efe 100755 --- a/.github/scripts/verify-site-scripts.sh +++ b/.github/scripts/verify-site-scripts.sh @@ -45,10 +45,19 @@ for f in "${files_to_check[@]}"; do fi sitef="$SITE_DIR/$base" - if [[ ! -f "$sitef" ]]; then - echo "MISSING site copy for $base" - EXIT_CODE=1 - continue + if [[ ! -d "$SITE_DIR" ]]; then + echo "NOTE: site directory not found; skipping docs->site diff checks for $base" + else + if [[ ! -f "$sitef" ]]; then + echo "MISSING site copy for $base" + EXIT_CODE=1 + continue + fi + # Compare content with site copy + if ! cmp -s "$docf" "$sitef"; then + echo "DIFF: $base differs between docs and site" + EXIT_CODE=1 + fi fi if [[ ! -f "$docf" ]]; then echo "MISSING docs copy for $base" diff --git a/docs/perfsonar/tools_scripts/fasterdata-tuning.sh b/docs/perfsonar/tools_scripts/fasterdata-tuning.sh index 37390039..975d0942 100755 --- a/docs/perfsonar/tools_scripts/fasterdata-tuning.sh +++ b/docs/perfsonar/tools_scripts/fasterdata-tuning.sh @@ -1084,7 +1084,7 @@ iface_audit() { local qdisc_val qdisc_rest qdisc_display if [[ -n "$qdisc" ]]; then qdisc_val="${qdisc%% *}" - qdisc_rest="${qdisc#${qdisc_val}}" + qdisc_rest="${qdisc#"${qdisc_val}"}" else qdisc_val="?" qdisc_rest="" From f76dcf36c2b3a8367e2c7331f445e7701f9190fe Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 09:09:33 -0500 Subject: [PATCH 2/9] fix(shellcheck): remove leading blank line to ensure shebang is first line (SC1128) --- .github/scripts/verify-site-scripts.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/scripts/verify-site-scripts.sh b/.github/scripts/verify-site-scripts.sh index bd1a0efe..3e623c30 100755 --- a/.github/scripts/verify-site-scripts.sh +++ b/.github/scripts/verify-site-scripts.sh @@ -1,4 +1,3 @@ - #!/usr/bin/env bash set -euo pipefail From 87c1fed91269bba80352e79a8d1538c1126f6c22 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 09:14:12 -0500 Subject: [PATCH 3/9] fix(shellcheck): address common shellcheck warnings (dbg form, case inline disable, ip route splitting comment, use sitef variable) --- .github/scripts/autoupdate-scripts-sha.sh | 2 +- .../tools_scripts/perfSONAR-auto-enroll-psconfig.sh | 2 +- docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh | 5 +++-- docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/scripts/autoupdate-scripts-sha.sh b/.github/scripts/autoupdate-scripts-sha.sh index 0759582b..0a56d891 100755 --- a/.github/scripts/autoupdate-scripts-sha.sh +++ b/.github/scripts/autoupdate-scripts-sha.sh @@ -35,7 +35,7 @@ for base in "${changed[@]}"; do fi sha=$(sha256sum "$docf" | awk '{print $1}') echo "$sha $docf" > "$DOCS_DIR/$base.sha256" - echo "$sha $docf" > "$SITE_DIR/$base.sha256" + echo "$sha $docf" > "$sitef.sha256" modified=1 echo "Updated sha for $base -> $sha" # Replace line in scripts.sha256 diff --git a/docs/perfsonar/tools_scripts/perfSONAR-auto-enroll-psconfig.sh b/docs/perfsonar/tools_scripts/perfSONAR-auto-enroll-psconfig.sh index 9bba529d..92ec236f 100755 --- a/docs/perfsonar/tools_scripts/perfSONAR-auto-enroll-psconfig.sh +++ b/docs/perfsonar/tools_scripts/perfSONAR-auto-enroll-psconfig.sh @@ -42,7 +42,7 @@ USE_DOCKER=0 log() { echo "[INFO] $*"; } err() { echo "[ERROR] $*" >&2; } -dbg() { [ "$VERBOSE" -eq 1 ] && echo "[DEBUG] $*" >&2 || true; } +dbg() { if [[ "$VERBOSE" -eq 1 ]]; then echo "[DEBUG] $*" >&2; fi; } # Persistent logging: try to write to /var/log, fall back to /tmp LOGFILE="/var/log/perfsonar-auto-enroll-psconfig.log" diff --git a/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh b/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh index 4da7dd7e..a45c7552 100755 --- a/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh +++ b/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh @@ -30,7 +30,8 @@ LOG_FILE="/var/log/perfsonar-orchestrator.log" DRY_RUN=false AUTO_YES=false NON_INTERACTIVE=false -AUTO_UPDATE=false + # shellcheck disable=SC2034 + AUTO_UPDATE=false DEPLOY_OPTION="A" # A or B LE_FQDN="" LE_EMAIL="" @@ -90,7 +91,7 @@ parse_cli() { --help|-h) sed -n '1,80p' "$0" | sed -n '1,80p' exit 0;; - --auto-update) AUTO_UPDATE=true; shift;; # shellcheck disable=SC2034 + --auto-update) AUTO_UPDATE=true; shift;; *) echo "Unknown arg: $1" >&2; exit 2;; esac done diff --git a/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh b/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh index 63999c24..38def732 100755 --- a/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh +++ b/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh @@ -1293,6 +1293,7 @@ configure_nic() { echo " - ${nic} adding static route to table $table_id for $ipv4_addroute" | tee -a "$LOG_FILE" if ! run_cmd nmcli con mod "$conn" +ipv4.routes "$ipv4_addroute table=$table_id"; then log "nmcli failed to add custom IPv4 route for $conn; falling back to ip route" + # shellcheck disable=SC2086 run_cmd ip route replace $ipv4_addroute table "$table_id" || log "Fallback: failed to add custom IPv4 route for $nic (may need manual intervention)" fi fi From 17f05e0bd17990be7c61965af5d8539e1a6eff9f Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 09:14:58 -0500 Subject: [PATCH 4/9] fix(shellcheck): silence unused AUTO_UPDATE by disabling SC2034 for its declaration --- docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh b/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh index a45c7552..feb20ff9 100755 --- a/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh +++ b/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh @@ -30,8 +30,8 @@ LOG_FILE="/var/log/perfsonar-orchestrator.log" DRY_RUN=false AUTO_YES=false NON_INTERACTIVE=false - # shellcheck disable=SC2034 - AUTO_UPDATE=false + # shellcheck disable=SC2034 +AUTO_UPDATE=false DEPLOY_OPTION="A" # A or B LE_FQDN="" LE_EMAIL="" From 093d683750c37ad0193ea0d83762348fa3d3c1c3 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 09:17:30 -0500 Subject: [PATCH 5/9] fix(shellcheck): ensure disable comment col 1 for AUTO_UPDATE var --- docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh b/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh index feb20ff9..7097e65a 100755 --- a/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh +++ b/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh @@ -30,7 +30,7 @@ LOG_FILE="/var/log/perfsonar-orchestrator.log" DRY_RUN=false AUTO_YES=false NON_INTERACTIVE=false - # shellcheck disable=SC2034 +# shellcheck disable=SC2034 AUTO_UPDATE=false DEPLOY_OPTION="A" # A or B LE_FQDN="" From bb5ec525118fbf7ba95aa98d7fd66fa7a21ebe6e Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 09:17:59 -0500 Subject: [PATCH 6/9] fix(shellcheck): silence unused PKG_APT/PKG_DNF with SC2034 disables --- docs/perfsonar/tools_scripts/check-deps.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/perfsonar/tools_scripts/check-deps.sh b/docs/perfsonar/tools_scripts/check-deps.sh index 07445fe0..9ce728d3 100755 --- a/docs/perfsonar/tools_scripts/check-deps.sh +++ b/docs/perfsonar/tools_scripts/check-deps.sh @@ -38,6 +38,7 @@ fi # PKG_DNF and PKG_APT are kept for documentation and future use; they may not be referenced directly # shellcheck disable=SC2034 PKG_DNF=(bash coreutils iproute NetworkManager rsync curl openssl) +# shellcheck disable=SC2034 PKG_APT=(bash coreutils iproute2 network-manager rsync curl openssl) declare -A CMD_TO_PKG_DNF=( From 18856f56e764cbeda026d00a63cedd6466418961 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 09:19:42 -0500 Subject: [PATCH 7/9] feat(orchestrator): run auto-update setup when --auto-update flag passed (use AUTO_UPDATE) --- docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh b/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh index 7097e65a..e695d119 100755 --- a/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh +++ b/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh @@ -46,7 +46,7 @@ RECOMMENDED_PACKAGES=( log() { local ts; ts="$(date +'%Y-%m-%d %H:%M:%S')" - echo "$ts $*" | tee -a "$LOG_FILE" + echo "$ts $*" | tee -a "$LOG_FILE" # Ensure consistent use of LOG_FILE } confirm() { @@ -194,9 +194,9 @@ step_security() { fi } +# shellcheck disable=SC2120 step_auto_update_compose() { # Create update script, systemd service and timer to run daily - # shellcheck disable=SC2120 if ! confirm "Create /usr/local/bin/perfsonar-auto-update.sh and enable systemd timer?"; then log "User skipped creating auto-update artifacts." return @@ -406,6 +406,11 @@ main() { need_root parse_cli "$@" preflight + if [ "$AUTO_UPDATE" = true ]; then + log "AUTO_UPDATE flag detected: enabling auto-update setup." + AUTO_YES=true + step_auto_update_compose + fi step_packages step_disable_conflicts step_bootstrap_tools From 100b6f994d8e5f4c2bcfee6d479d433a3fa7b41e Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 09:21:21 -0500 Subject: [PATCH 8/9] chore(shellcheck): suppress style warnings for pbr-nm, add heredoc shellcheck disable in orchestrator --- docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh | 1 + docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh b/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh index e695d119..365fdcee 100755 --- a/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh +++ b/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh @@ -202,6 +202,7 @@ step_auto_update_compose() { return fi + # shellcheck disable=SC2153 run bash -c "cat > /usr/local/bin/perfsonar-auto-update.sh <<'EOF' #!/bin/bash set -e diff --git a/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh b/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh index 38def732..f1f09d6e 100755 --- a/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh +++ b/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh @@ -1,3 +1,6 @@ +# shellcheck disable=SC2004 +#!/usr/bin/env bash + #!/bin/bash # # Multi-NIC perfSONAR NetworkManager Configuration Script From 6a9e2e0774aa3827abf2b1dd544b16043a421679 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Dec 2025 09:21:57 -0500 Subject: [PATCH 9/9] fix(shellcheck): ensure shebang is first line and disable SC2004 at top --- docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh b/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh index f1f09d6e..24df11f8 100755 --- a/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh +++ b/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh @@ -1,7 +1,6 @@ -# shellcheck disable=SC2004 #!/usr/bin/env bash +# shellcheck disable=SC2004 -#!/bin/bash # # Multi-NIC perfSONAR NetworkManager Configuration Script # ------------------------------------------------------