Compare commits

...

8 Commits

Author SHA1 Message Date
6b73b5c79a update wol
All checks were successful
Generate README / build (push) Successful in 7s
2025-12-02 23:36:00 -05:00
94d2c711ce push wol
All checks were successful
Generate README / build (push) Successful in 7s
2025-12-02 23:33:44 -05:00
gitea-bot
7770e09feb docs: auto-generate README for scripts [skip ci] 2025-12-03 04:23:14 +00:00
5545ccaf1f fugma
All checks were successful
Generate README / build (push) Successful in 8s
2025-12-02 23:22:41 -05:00
d82a96eccb revert ee69659a82
revert Merge branch 'main' of https://git.hudsonriggs.systems/HRiggs/tools
2025-12-03 04:22:05 +00:00
133b6fb281 revert 5b8120eb27
All checks were successful
Generate README / build (push) Successful in 8s
revert fix remote url
2025-12-03 04:21:50 +00:00
ee69659a82 Merge branch 'main' of https://git.hudsonriggs.systems/HRiggs/tools
Some checks failed
Generate README / build (push) Failing after 8s
2025-12-02 23:19:43 -05:00
5b8120eb27 fix remote url 2025-12-02 23:19:42 -05:00
3 changed files with 62 additions and 32 deletions

View File

@@ -11,37 +11,37 @@ Run on Linux/macOS using curl:
### enable_wol_proxmox.sh
```bash
curl -fsSL -o enable_wol_proxmox.sh "ssh://git@git.hudsonriggs.systems:22113/HRiggs/tools/raw/branch/main/enable_wol_proxmox.sh" && chmod +x enable_wol_proxmox.sh && ./"enable_wol_proxmox.sh"
curl -fsSL -o enable_wol_proxmox.sh "https://git.hudsonriggs.systems/HRiggs/Tools/raw/branch/main/enable_wol_proxmox.sh" && chmod +x enable_wol_proxmox.sh && ./"enable_wol_proxmox.sh"
```
### fakepve.sh
```bash
curl -fsSL -o fakepve.sh "ssh://git@git.hudsonriggs.systems:22113/HRiggs/tools/raw/branch/main/fakepve.sh" && chmod +x fakepve.sh && ./"fakepve.sh"
curl -fsSL -o fakepve.sh "https://git.hudsonriggs.systems/HRiggs/Tools/raw/branch/main/fakepve.sh" && chmod +x fakepve.sh && ./"fakepve.sh"
```
### list_root_domains.sh
```bash
curl -fsSL -o list_root_domains.sh "ssh://git@git.hudsonriggs.systems:22113/HRiggs/tools/raw/branch/main/list_root_domains.sh" && chmod +x list_root_domains.sh && ./"list_root_domains.sh"
curl -fsSL -o list_root_domains.sh "https://git.hudsonriggs.systems/HRiggs/Tools/raw/branch/main/list_root_domains.sh" && chmod +x list_root_domains.sh && ./"list_root_domains.sh"
```
### selfsigned_certs.sh
```bash
curl -fsSL -o selfsigned_certs.sh "ssh://git@git.hudsonriggs.systems:22113/HRiggs/tools/raw/branch/main/selfsigned_certs.sh" && chmod +x selfsigned_certs.sh && ./"selfsigned_certs.sh"
curl -fsSL -o selfsigned_certs.sh "https://git.hudsonriggs.systems/HRiggs/Tools/raw/branch/main/selfsigned_certs.sh" && chmod +x selfsigned_certs.sh && ./"selfsigned_certs.sh"
```
### setup-nut-slave.sh
```bash
curl -fsSL -o setup-nut-slave.sh "ssh://git@git.hudsonriggs.systems:22113/HRiggs/tools/raw/branch/main/setup-nut-slave.sh" && chmod +x setup-nut-slave.sh && ./"setup-nut-slave.sh"
curl -fsSL -o setup-nut-slave.sh "https://git.hudsonriggs.systems/HRiggs/Tools/raw/branch/main/setup-nut-slave.sh" && chmod +x setup-nut-slave.sh && ./"setup-nut-slave.sh"
```
### setup_deploy_user.sh
```bash
curl -fsSL -o setup_deploy_user.sh "ssh://git@git.hudsonriggs.systems:22113/HRiggs/tools/raw/branch/main/setup_deploy_user.sh" && chmod +x setup_deploy_user.sh && ./"setup_deploy_user.sh"
curl -fsSL -o setup_deploy_user.sh "https://git.hudsonriggs.systems/HRiggs/Tools/raw/branch/main/setup_deploy_user.sh" && chmod +x setup_deploy_user.sh && ./"setup_deploy_user.sh"
```
## Windows (.bat)
@@ -52,10 +52,10 @@ Run from PowerShell:
```powershell
$dest = Join-Path $env:TEMP "win-mao.bat";
Invoke-WebRequest -Uri "ssh://git@git.hudsonriggs.systems:22113/HRiggs/tools/raw/branch/main/win-mao.bat" -OutFile $dest;
Invoke-WebRequest -Uri "https://git.hudsonriggs.systems/HRiggs/Tools/raw/branch/main/win-mao.bat" -OutFile $dest;
& $dest
```
---
Generated from repo: `ssh://git@git.hudsonriggs.systems:22113/HRiggs/tools` on branch `main`.
Generated from repo: `https://git.hudsonriggs.systems/HRiggs/Tools` on branch `main`.

View File

@@ -21,6 +21,47 @@ info() {
echo "[*] $*"
}
# Return 0 if interface is physical (non-virtual)
is_physical_iface() {
local iface="$1"
local dev_path
dev_path=$(readlink -f "/sys/class/net/${iface}/device" 2>/dev/null || true)
[[ -n "$dev_path" && "$dev_path" != *"/virtual/"* ]]
}
# Resolve bridge/bond to the underlying physical NIC, if possible
resolve_physical_iface() {
local iface="$1"
local candidate resolved
# If iface is a bridge, iterate its members
if [[ -d "/sys/class/net/${iface}/bridge" ]]; then
for brif in /sys/class/net/${iface}/brif/*; do
[[ -e "$brif" ]] || continue
candidate=$(basename "$brif")
resolved=$(resolve_physical_iface "$candidate")
[[ -n "$resolved" ]] && echo "$resolved" && return
done
fi
# If iface is a bond, walk its slaves
if [[ -f "/sys/class/net/${iface}/bonding/slaves" ]]; then
for slave in $(<"/sys/class/net/${iface}/bonding/slaves"); do
resolved=$(resolve_physical_iface "$slave")
[[ -n "$resolved" ]] && echo "$resolved" && return
done
fi
# If iface itself is physical, return it
if is_physical_iface "$iface"; then
echo "$iface"
return
fi
# Fallback: return original iface even if virtual
echo "$iface"
}
# --- Preconditions -----------------------------------------------------------
if [[ $EUID -ne 0 ]]; then
@@ -66,6 +107,14 @@ fi
info "Detected primary interface: ${PRIMARY_IF}"
PHYSICAL_IF=$(resolve_physical_iface "$PRIMARY_IF")
if [[ "$PHYSICAL_IF" != "$PRIMARY_IF" ]]; then
info "Resolved underlying physical interface: ${PHYSICAL_IF}"
PRIMARY_IF="$PHYSICAL_IF"
else
info "Using ${PRIMARY_IF} as the primary physical interface."
fi
# --- Get MAC address & IP ----------------------------------------------------
MAC_ADDR=$(ip -o link show "$PRIMARY_IF" | awk '{for (i=1; i<=NF; i++) if ($i=="link/ether") print $(i+1)}')
@@ -144,10 +193,10 @@ fi
info "Verifying WOL is enabled on ${PRIMARY_IF}..."
VERIFY_OUTPUT=$(ethtool "$PRIMARY_IF")
WAKE_ON=$(awk -F: '/Wake-on/ {gsub(/ /,"",$2); print $2}' <<<"$VERIFY_OUTPUT")
WAKE_ON=$(awk -F: '$1 ~ /^[[:space:]]*Wake-on$/ {gsub(/ /,"",$2); print $2; exit}' <<<"$VERIFY_OUTPUT")
if [[ "$WAKE_ON" != "g" ]]; then
err "WOL verification failed: Wake-on is '${WAKE_ON}', expected 'g'. Check BIOS settings and /etc/network/interfaces."
if [[ "$WAKE_ON" != *g* ]]; then
err "WOL verification failed: Wake-on is '${WAKE_ON}', expected to include 'g'. Check BIOS settings and /etc/network/interfaces."
fi
info "WOL verification succeeded: Wake-on is '${WAKE_ON}'."

View File

@@ -5,27 +5,8 @@ set -euo pipefail
# This file is intended to be run in CI and locally.
determine_repo_web_base() {
local origin_url
origin_url="$(git config --get remote.origin.url || true)"
if [[ -z "${origin_url}" ]]; then
echo "Error: could not determine git remote origin URL" >&2
exit 1
fi
local web_base
if [[ "${origin_url}" =~ ^https?:// ]]; then
web_base="${origin_url%.git}"
elif [[ "${origin_url}" =~ ^git@([^:]+):(.+)\.git$ ]]; then
local host path
host="${BASH_REMATCH[1]}"
path="${BASH_REMATCH[2]}"
web_base="https://${host}/${path}"
else
# Fallback: strip trailing .git if present
web_base="${origin_url%.git}"
fi
printf '%s' "${web_base}"
# Use hardcoded base URL
printf '%s' "https://git.hudsonriggs.systems/HRiggs/Tools"
}
determine_branch() {