Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: netwake use default interface automatically #3

Open
akhepcat opened this issue Mar 18, 2015 · 1 comment
Open

Feature: netwake use default interface automatically #3

akhepcat opened this issue Mar 18, 2015 · 1 comment

Comments

@akhepcat
Copy link

echo *****************************
echo  MINIMIZE THIS ACTIVE PING 
echo   NetPi KEEPALIVE RUNNING! 
echo *****************************
iface=$(awk 'BEGIN { IGNORECASE=1 } /^[a-z0-9]+[ \t]+00000000/ { print $1 }' /proc/net/route)
if [ -z "$iface" ]
then
  echo "no active IPv4 interface"
  sleep 4
  exit 1
fi
gw="$(ip -4 route show route default dev $iface | cut -d\  -f3)"
ping $gw
@BlameTheNetwork
Copy link
Owner

Good call! Pinging if nothing is active doesn't do much good, you are correct. I pushed your code and provided attribution to you as a comment. Thanks for the improvement! I'll roll it into the next IMG version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants