[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: missing gw in route -n



On Wed, 18 Jul 2018, David Billsbrough wrote:

I played with script on an Intel box running Debian and made a few changes:


On a similar note it reminded me of this I'd written about a year ago. It brings an interface down then up if it can't ping google once as a test. It would crash hard if there was some billing screwup and my phone got shut off. You can change the logging location to something other than /usr/programs/scripts/dhcp/resets.txt and the interface name. The real world problem I was seeing is that if the cell phone is trying out a signal from a different tower that dumps the internet temporarily. I was calling this from a cron job every 10 minutes.

#!/bin/bash
declare tries=0
until  (ping -c 1 www.google.com > /dev/null) || (tries > 9) ; do
  tries++
  /sbin/ifdown wlan0
  /bin/sleep 1
  /sbin/ifup wlan0
  /bin/date >> /usr/programs/scripts/dhcp/resets.txt
  if tries > 9 ; then
    echo "\nMany retries\n" >> /usr/programs/scripts/dhcp/resets.txt ;
  fi;
done

Nothing to do with routes explcitly.


#!/bin/bash
#
# $Id: check-ifaces.sh,v 0.3 2018/07/17 19:17:46 kc4zvw Exp kc4zvw $

# Somewhat tested, now there may be more bugs, your mileage might vary

REPORT_FILE=$0.out

function check_ip()
{
       echo "Run 'sudo apt-get install iproute2' for needed tools."
       exit 1
}

function setup_report_file()
{
       rm $REPORT_FILE
       touch $REPORT_FILE
}

function out()
{
       echo -e "\n#### Running: ${@} ####\n" | tee -a $REPORT_FILE
       ## $@ | tee -a $REPORT_FILE
       $@ >> $REPORT_FILE
}

## ----- main begins here -----

echo
echo "Started to collect data ..."
echo

setup_report_file
which ip || check_ip

out ip a
out ip l
out ip route
out ps ax
out cat /etc/resolv.conf

for f in $(find /etc/network -type f)
do
       [[ -f "$f" ]] && [[ "$(file "$f")" =~ text ]] && out cat "$f";
done

echo
echo "All data saved to $REPORT_FILE."

# End of File



-=-=-=-=-


regards,

David

-----Original Message-----

From: Christopher Barry <cbarry@symbiaudix.com>
Sent: Jul 12, 2018 11:36 PM
To: debian-arm@lists.debian.org
Subject: Re: missing gw in route -n

On Thu, 12 Jul 2018 21:52:13 -0400
Gene Heskett <gheskett@shentel.net> wrote:

On Thursday 12 July 2018 18:04:54 Christian Knoke wrote:

Du schriebst am 12. Jul um 16:57 Uhr:
On Thursday 12 July 2018 14:16:43 Christian Knoke wrote:
Gene Heskett schrieb am 12. Jul um 10:07 Uhr:

hth

Not yet.  If I can't fix this tomorrow, I'll write another sd card
...snip

follow the below 5 steps for help solving this.

1.) highlight/copy from the NEXT line down to the line '# EOF'
#!/bin/bash
# untested, there may be bugs, ymmv

which ip || {
   echo "run 'sudo apt-get install iproute2' for needed tools"
   exit 1
}

$0.out

function out() {
   echo -e "\n#### running: ${@} ####\n"; $@ | tee -a $0.out
}

out ip a
out ip l
out ip r
out ps ax
out cat /etc/resolv.conf

for f in $(find /etc/network -type f); do
   [[ -f ${f} && "$(file "${f}")" =~ text ]] && {
	out cat "${f}"
   }
done

echo "data saved to $0.out"

# EOF

2.) paste/save that into a new text file named ck-ifaces

3.) then in terminal as root, run:

you@box:~# sh /path/to/ck-ifaces

4.) post 'contents' of ck-ifaces.out to pastebin.com (not here on list)

5.) post 'link' to your pastbin data here


--
Regards,
Christopher Barry


--
David - Chuluota, FL

--




---
Sent from Alpine connected to Gmail on my 64-bit Raspberry Pi


Reply to: