From 040911f8b9f599c3172833d556bbc2cfeb2ba698 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sat, 27 Apr 2013 20:00:56 -0300 Subject: [PATCH] bin/fk: add option -u to force usbboot, even if SSH is/seems available --- bin/fk | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/bin/fk b/bin/fk index 85548e3..9e2ee67 100755 --- a/bin/fk +++ b/bin/fk @@ -1,13 +1,17 @@ #!/bin/sh -e -if [ "${1#usb}" = "$1" ]; then - if ! ping -c 1 -w 1 "$1" >/dev/null; then - echo "no ping response from $1" 1>&2 - exit 1 - fi - NN=$1 +if [ "$1" = -u ]; then + NN= else - NN=`ifconfig ${1:-usb0} | - sed '/.*inet addr:\([^ ]*\).*/{s//\1/;s/100$/101/;s/200$/202/;p;};d'` + if [ "${1#usb}" = "$1" ]; then + if ! ping -c 1 -w 1 "$1" >/dev/null; then + echo "no ping response from $1" 1>&2 + exit 1 + fi + NN=$1 + else + NN=`ifconfig ${1:-usb0} | + sed '/.*inet addr:\([^ ]*\).*/{s//\1/;s/100$/101/;s/200$/202/;p;};d'` + fi fi if [ "$NN" ]; then echo "SCP to $NN" 1>&2