Skip to content

Feature: netwake use default interface automatically #3

@akhepcat

Description

@akhepcat
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions