Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Find most recent USB network interface
iface=$(ip -o link | awk -F': ' '/enx|usb/ {print $2}' | tail -n 1)
if [ -z "$iface" ]; then
echo "❌ No USB network interface found."
exit 1
fi