Skip to content
Merged
2 changes: 1 addition & 1 deletion .github/scripts/autoupdate-scripts-sha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 13 additions & 5 deletions .github/scripts/verify-site-scripts.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#!/usr/bin/env bash
set -euo pipefail

Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions docs/perfsonar/tools_scripts/check-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=(
Expand Down
2 changes: 1 addition & 1 deletion docs/perfsonar/tools_scripts/fasterdata-tuning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 10 additions & 3 deletions docs/perfsonar/tools_scripts/perfSONAR-orchestrator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand All @@ -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() {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion docs/perfsonar/tools_scripts/perfSONAR-pbr-nm.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
#!/usr/bin/env bash
# shellcheck disable=SC2004

#
# Multi-NIC perfSONAR NetworkManager Configuration Script
# ------------------------------------------------------
Expand Down Expand Up @@ -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
Expand Down
Loading