From b0374f87e7d8649b146cf70ba82a563bf4b190df Mon Sep 17 00:00:00 2001 From: 28allday Date: Fri, 3 Jul 2026 19:27:21 +0100 Subject: [PATCH] Fix SIGPIPE under pipefail in status (awk-exit and head -1 pipelines) Co-Authored-By: Claude Fable 5 --- omatether.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/omatether.sh b/omatether.sh index 5f44592..6f9a2eb 100755 --- a/omatether.sh +++ b/omatether.sh @@ -117,7 +117,8 @@ cmd_unpair() { cmd_status() { local iface udid name - if udid=$(idevice_id -l 2>/dev/null | head -1) && [[ -n $udid ]]; then + udid=$(idevice_id -l 2>/dev/null | head -1 || true) + if [[ -n $udid ]]; then name=$(ideviceinfo -k DeviceName 2>/dev/null || echo "unknown") ok "iPhone connected over USB: $name" if idevicepair validate >/dev/null 2>&1; then @@ -131,7 +132,7 @@ cmd_status() { if iface=$(tether_iface); then local state addr - state=$(networkctl status "$iface" 2>/dev/null | awk '/State:/{print $2; exit}') + state=$(networkctl status "$iface" 2>/dev/null | awk '/State:/{print $2; exit}' || true) ok "Tether interface: $iface ($state)" addr=$(ip -4 -br addr show "$iface" | awk '{print $3}') if [[ -n $addr ]]; then