Skip to content

Fix fatal syntax error and complete the setup flow - #1

Open
TheRealBrofessor wants to merge 2 commits into
exterus:mainfrom
TheRealBrofessor:fix/setup-and-syntax
Open

Fix fatal syntax error and complete the setup flow#1
TheRealBrofessor wants to merge 2 commits into
exterus:mainfrom
TheRealBrofessor:fix/setup-and-syntax

Conversation

@TheRealBrofessor

Copy link
Copy Markdown

main’s pylon.sh does not run at all — a duplicate toggle) block was left dangling after main "$@", so bash aborts with syntax error near unexpected token ) before any command executes. toggle is already wired to tx_toggle() in the case statement, so that trailing block was dead code. Removing it makes the script parse and run.

Changes

pylon.sh

  • Remove the dangling toggle) block after main "$@" (the actual syntax error).
  • install_self()setup now copies the script to /usr/local/bin/pylon.sh. The README tells users to run it from there, but nothing ever installed it.
  • write_modprobe_conf()setup writes a max-throughput /etc/modprobe.d/8814au.conf (USB 3.0 SuperSpeed + power-save off) for the AWUS1900/RTL8814AU and hot-reloads the module. Falls back to USB 2.0 mode via a commented line for adapters that fail to enumerate on USB 3.
  • Graceful setup when the adapter is absent — deps, driver profile, and self-install run first; the udev rename step is skipped with a clear message instead of hard-exiting, so a first run before plugging in still provisions the host.

pylon-bootstrap.sh (new)

  • One command: recovers a wedged xHCI USB port (unbind/bind), runs setup, waits for the interface, brings it up, and prints an audit. Never touches internal/PCIe wifi.

Test

  • bash -n pylon.sh → clean (was a hard syntax error on main).
  • bash pylon.sh with no args prints usage instead of aborting.

🤖 Generated with Claude Code

TheRealBrofessor and others added 2 commits August 31, 2026 01:37
pylon.sh on main does not run at all: a duplicate `toggle)` block was
left dangling after `main "$@"`, so bash aborts with a syntax error
before any command executes. The `toggle` command is already wired to
tx_toggle() in the case statement, so the trailing block was dead code.
Removed it; the script now parses and runs.

Also completes setup() so it matches what the README promises:
- install_self(): copies pylon.sh to /usr/local/bin (README documents
  running it from there, but nothing ever installed it)
- write_modprobe_conf(): writes a max-throughput /etc/modprobe.d/8814au.conf
  (USB 3.0 + power-save off) and hot-reloads the driver
- setup() no longer hard-fails when the adapter is absent: deps, driver
  profile, and self-install run first; the udev rename is skipped with a
  clear message if the device is not yet on USB

Adds pylon-bootstrap.sh: one command that recovers a wedged xHCI port,
runs setup, waits for the interface, brings it up, and audits. Never
touches internal wifi.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
USB 3.0 SuperSpeed negotiation is the exact step that fails with error
-71 on flaky ports/cables. write_modprobe_conf now verifies the adapter
re-enumerates after the driver reload; if the interface does not return
within 15s, it comments the USB3 line, uncomments the USB2 fallback, and
reloads again — so setup never leaves a previously-working adapter dead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant