X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=sbin%2Fnetcardconfig;h=4a3cd713c47de7ea59ecf412f6c28e1601c96797;hb=5681e2bcbd6864dfba753aa4a9f240d30ac085b6;hp=8916642d5074e440e2628435ef47123135aaa745;hpb=ab3ad1162ab10673efd3022a26792cad60633767;p=grml-network.git diff --git a/sbin/netcardconfig b/sbin/netcardconfig index 8916642..4a3cd71 100755 --- a/sbin/netcardconfig +++ b/sbin/netcardconfig @@ -410,7 +410,12 @@ configiface() { $DIALOG --inputbox "$MESSAGE8 $DV" 10 45 "${BC:-${IP%.*}.255}" 2>"$TMP" || bailout 1 read -r BC <"$TMP" ; rm -f "$TMP" - $DIALOG --inputbox "$MESSAGE9" 10 45 "${DG:-${IP%.*}.1}" 2>"$TMP" + # if we already have a default route, don't suggest to add another one as that might fail + __default_gw="" + if ! route -en | grep -q '^0.0.0.0' ; then + __default_gw="${DG:-${IP%.*}.1}" + fi + $DIALOG --inputbox "$MESSAGE9" 10 45 "${__default_gw}" 2>"$TMP" read -r DG <"$TMP" ; rm -f "$TMP" if [ -f "/etc/resolv.conf" ]; then