[Linuxcommand-discuss] is_ppp_up shell function - enjoy!
Brought to you by:
bshotts
|
From: William S. <bs...@tw...> - 2000-10-28 18:36:55
|
function is_ppp_up
{
#####
# Function to test for PPP connection. Returns 0 exit
# status on success (ppp0 is up)
#
# Written by William Shotts <bs...@cl...>
# Arguments:
# none
#####
netstat -r | grep ppp0 > /dev/null
} # end of is_ppp_up
Sample Usage:
echo -e "Checking for network connection... \c"
if is_ppp_up
then
echo -e "Ok"
else
echo -e "Network down!"
exit 1
fi
--
||||| William Shotts, Jr. (bs...@cl...)
||||| http://www.clark.net/pub/bshotts/ (Updated 04/13/2000)
||||| Be a Linux Commander! Follow me to http://linuxcommand.org
|