diff options
author | Mystery Man <unknown@mandriva.org> | 2002-09-20 13:59:57 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2002-09-20 13:59:57 +0000 |
commit | 4394adc363246f041a3eb2a75bfbe451c36bb922 (patch) | |
tree | 23c54c7c0c3deb3dfc6d4ebf9cbf6f3dddf83470 /mdk-stage1/rp-pppoe/scripts/adsl-status | |
parent | 657b3d01707e205499e3c867cb174c7e0fa1a83e (diff) | |
download | drakx-4394adc363246f041a3eb2a75bfbe451c36bb922.tar drakx-4394adc363246f041a3eb2a75bfbe451c36bb922.tar.gz drakx-4394adc363246f041a3eb2a75bfbe451c36bb922.tar.bz2 drakx-4394adc363246f041a3eb2a75bfbe451c36bb922.tar.xz drakx-4394adc363246f041a3eb2a75bfbe451c36bb922.zip |
This commit was manufactured by cvs2svn to create tag 'V1_1_9_53mdk'.V1_1_9_53mdk
Diffstat (limited to 'mdk-stage1/rp-pppoe/scripts/adsl-status')
-rwxr-xr-x | mdk-stage1/rp-pppoe/scripts/adsl-status | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/mdk-stage1/rp-pppoe/scripts/adsl-status b/mdk-stage1/rp-pppoe/scripts/adsl-status deleted file mode 100755 index 18b100ab2..000000000 --- a/mdk-stage1/rp-pppoe/scripts/adsl-status +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh -#*********************************************************************** -# -# adsl-status -# -# Shell script to report on status of ADSL connection -# -# Copyright (C) 2000-2001 Roaring Penguin Software Inc. -# -# $Id$ -# -# This file may be distributed under the terms of the GNU General -# Public License. -# -# Usage: adsl-status [config_file] -# If config_file is omitted, defaults to /etc/ppp/pppoe.conf -# -#*********************************************************************** - -# Defaults -CONFIG=/etc/ppp/pppoe.conf - -case "$#" in - 1) - CONFIG="$1" - ;; -esac - -if [ ! -f "$CONFIG" -o ! -r "$CONFIG" ] ; then - echo "$0: Cannot read configuration file '$CONFIG'" >& 2 - exit 1 -fi - -. $CONFIG - -PPPOE_PIDFILE="$PIDFILE.pppoe" -PPPD_PIDFILE="$PIDFILE.pppd" - -if [ "$DEMAND" != "no" ] ; then - echo "Note: You have enabled demand-connection; adsl-status may be inaccurate." -fi - -# If no PPPOE_PIDFILE, connection is down, unless we're using the Linux plugin -if [ "$LINUX_PLUGIN" = "" ] ; then - if [ ! -r "$PPPOE_PIDFILE" ] ; then - echo "adsl-status: Link is down (can't read pppoe PID file $PPPOE_PIDFILE)" - exit 1 - fi -fi - -# If no PPPD_PIDFILE, something fishy! -if [ ! -r "$PPPD_PIDFILE" ] ; then - echo "adsl-status: Link is down (can't read pppd PID file $PPPD_PIDFILE)" - exit 1 -fi - -PPPD_PID=`cat "$PPPD_PIDFILE"` - -# Sigh. Some versions of pppd put PID files in /var/run; others put them -# in /etc/ppp. Since it's too messy to figure out what pppd does, we -# try both locations. -for i in /etc/ppp/ppp*.pid /var/run/ppp*.pid ; do - if [ -r $i ] ; then - PID=`cat $i` - if [ "$PID" = "$PPPD_PID" ] ; then - IF=`basename $i .pid` - netstat -rn | grep " ${IF}\$" > /dev/null - # /sbin/ifconfig $IF | grep "UP.*POINTOPOINT" > /dev/null - if [ "$?" != "0" ] ; then - echo "adsl-status: Link is attached to $IF, but $IF is down" - exit 1 - fi - echo "adsl-status: Link is up and running on interface $IF" - /sbin/ifconfig $IF - exit 0 - fi - fi -done - -echo "adsl-status: Link is down -- could not find interface corresponding to" -echo "pppd pid $PPPD_PID" -exit 1
\ No newline at end of file |