Establish shellcheck as a mandatory pre-commit quality gate and bring all 93
shell scripts to a clean state.
- tests/shellcheck.sh: wrapper that runs koalaman/shellcheck:stable via Docker
(no native binary needed), skips vendored + upstream librenms-agent scripts.
- .shellcheckrc: documents intentional codebase-wide disables (dynamic source
paths SC1090/SC1091, client-side ssh expansion SC2029).
- AGENTS.md: new Git Policy rule mandating clean shellcheck for every shell
script before commit.
Fixes applied (real bugs + quality): missing quote in netinfra/gather-configs.sh
(caused cascading parse errors), unquoted expansions, declare-and-assign masking,
egrep -> grep -E, $FUNCNAME array indexing, unused variable removal, cd || exit.
Intentional patterns (sourced config, sysfs/ps diagnostics, ssh heredocs that
expand local config) get justified targeted disables.
💘 Generated with Crush
Assisted-by: Crush:glm-5.2
25 lines
733 B
Bash
25 lines
733 B
Bash
#!/bin/bash
|
|
|
|
|
|
|
|
#magic to detect main int
|
|
echo "Determining management interface..."
|
|
#export MAIN_INT=$(brctl show $(netstat -rn|grep 0.0.0.0|head -n1|awk '{print $NF}') | awk '{print $NF}'|tail -1|awk -F '.' '{print $1}')
|
|
MAIN_INT=$(brctl show|grep vmbr0|awk '{print $NF}'|awk -F '.' '{print $1}')
|
|
export MAIN_INT
|
|
|
|
echo "Management interface is: $MAIN_INT"
|
|
|
|
#fix the issue
|
|
echo "Fixing management interface..."
|
|
ethtool -K "$MAIN_INT" tso off
|
|
ethtool -K "$MAIN_INT" gro off
|
|
ethtool -K "$MAIN_INT" gso off
|
|
ethtool -K "$MAIN_INT" tx off
|
|
ethtool -K "$MAIN_INT" rx off
|
|
|
|
#https://forum.proxmox.com/threads/e1000-driver-hang.58284/
|
|
#https://serverfault.com/questions/616485/e1000e-reset-adapter-unexpectedly-detected-hardware-unit-hang
|
|
|
|
|