diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2017-03-07 23:23:54 +0100 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2017-03-10 20:40:27 +0100 |
commit | 3abf8a36314a2bec05dbaeef9c43d73263dde9c1 (patch) | |
tree | 080a63b141e0457bc2b3fb33514f63e2580911b1 /networking/usb | |
parent | ad715ec018f7b9c7e1f8fff0df8aef24a08b1f1a (diff) | |
download | vendor_replicant-scripts-3abf8a36314a2bec05dbaeef9c43d73263dde9c1.tar.gz vendor_replicant-scripts-3abf8a36314a2bec05dbaeef9c43d73263dde9c1.tar.bz2 vendor_replicant-scripts-3abf8a36314a2bec05dbaeef9c43d73263dde9c1.zip |
usb/networking: abort if no gateway is found
Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
Diffstat (limited to 'networking/usb')
-rw-r--r-- | networking/usb/usb_networking_device.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/networking/usb/usb_networking_device.sh b/networking/usb/usb_networking_device.sh index 254bd4e..8351c26 100644 --- a/networking/usb/usb_networking_device.sh +++ b/networking/usb/usb_networking_device.sh @@ -51,6 +51,13 @@ clear_iface () { setup_iface () { gateway=$(ip route show 0.0.0.0/0 dev $USB_IFACE | cut -d\ -f3) + + if [ "$gateway" = "" ]; then + echo "Error: no route available" + echo "Make sure your PC is configured correctly for usb networking" + exit 1 + fi + echo "Your gateway is $gateway" ndc network create 1 ndc network interface add 1 "$USB_IFACE" |