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