Fix SIGPIPE under pipefail in status (awk-exit and head -1 pipelines)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
4d30b9d55a
commit
b0374f87e7
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue