Compare commits

..

No commits in common. "master" and "v0.1.0" have entirely different histories.

2 changed files with 6 additions and 28 deletions

2
.gitignore vendored
View file

@ -1,2 +0,0 @@
CLAUDE.local.md
STATUS.md

View file

@ -71,21 +71,6 @@ net_test() {
curl -sf --interface "$iface" --max-time 5 -o /dev/null https://www.google.com
}
# Poll until the tether has an IP and working internet, or time out (arg:
# seconds). First plug-in after a reboot can take 20-30s before iOS brings
# the interface up and DHCP completes — a fixed short sleep reports false
# "enable hotspot" advice.
tether_wait() {
local deadline=$(( SECONDS + ${1:-45} )) iface
while (( SECONDS < deadline )); do
if iface=$(tether_iface) && [[ -n $(tether_ip "$iface") ]] && net_test "$iface"; then
return 0
fi
sleep 2
done
return 1
}
# usbmuxd drops devices that were plugged in before it started
# ("device unconfigured") — a restart rescans the bus.
revive_usbmuxd() {
@ -397,19 +382,14 @@ tui_connect() {
ok "Paired with $(phone_name)"
fi
# Poll for the connection — first plug-in after a reboot can take 20-30s
# (functions exported so the gum spin child shell can run them).
# Give networkd a moment to DHCP the freshly-authorised interface.
local iface=""
export -f tether_wait tether_iface tether_ip net_test
if gum spin --title "Bringing the connection up… (can take ~30s after a reboot)" -- \
bash -c 'tether_wait 45'; then
iface=$(tether_iface || true)
ok "Connected — internet available through the phone (${iface:-tether})"
gum spin --title "Bringing the connection up…" -- sleep 4 || true
if iface=$(tether_iface) && [[ -n $(tether_ip "$iface") ]] && net_test "$iface"; then
ok "Connected — internet available through the phone ($iface)"
else
warn "Paired, but the phone hasn't offered a connection yet. Check:"
say " • Settings → Personal Hotspot → Allow Others to Join: ON"
say " • Unlock the phone once (needed after a phone restart)"
say " • Still nothing? Unplug and replug the cable, then Connect again."
warn "Paired, but no connection yet. On the phone enable:"
say " Settings → Personal Hotspot → Allow Others to Join: ON"
fi
pause
}