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/.github/scripts/verify-site-scripts.sh b/.github/scripts/verify-site-scripts.sh index ddf26295..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 @@ -45,10 +44,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/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=( 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="" 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..365fdcee 100755 --- a/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh +++ b/docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh @@ -30,6 +30,7 @@ LOG_FILE="/var/log/perfsonar-orchestrator.log" DRY_RUN=false AUTO_YES=false NON_INTERACTIVE=false +# shellcheck disable=SC2034 AUTO_UPDATE=false DEPLOY_OPTION="A" # A or B LE_FQDN="" @@ -45,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() { @@ -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 @@ -193,14 +194,15 @@ 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 fi + # shellcheck disable=SC2153 run bash -c "cat > /usr/local/bin/perfsonar-auto-update.sh <<'EOF' #!/bin/bash set -e @@ -405,6 +407,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 diff --git a/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh b/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh index 63999c24..24df11f8 100755 --- a/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh +++ b/docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh @@ -1,4 +1,6 @@ -#!/bin/bash +#!/usr/bin/env bash +# shellcheck disable=SC2004 + # # Multi-NIC perfSONAR NetworkManager Configuration Script # ------------------------------------------------------ @@ -1293,6 +1295,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