The script for pon is:

      /usr/sbin/ppp call ${1:-provider}

plog:

     tail $* /var/log/ppp.log

poff:

#!/bin/sh

# $Id: poff,v 1.4 1998/05/26 14:46:08 phil Exp $
# Written by Phil Hands <[EMAIL PROTECTED]>, distributed under the GNU GPL

SIG=TERM DONE=stopped;

getopts rdch FLAG
case $FLAG in
 "r") SIG=HUP  DONE=signalled; shift  ;;
 "d") SIG=USR1 DONE=signalled; shift ;;
 "c") SIG=USR2 DONE=signalled; shift ;;
 "h") cat <<!EOF!
usage: $0 [options] [provider]

options:
  -r        cause pppd to drop the line and redial
  -d        toggles the state of pppd's debug option
  -c        cause pppd to renegotiate compression
  -h        this help summary
!EOF!
    exit 1
    ;;
esac

PROVIDER=$1


# Lets see how many pppds are running....
set -- `cat /var/run/ppp*.pid 2>/dev/null`

case $# in
  0) # pppd only creates a pid file once ppp is up, so let's try killing
pppd
     # on the assumption that we've not got that far yet.
     kill -${SIG} `ps axw | egrep "pppd call [[:alnum:]]+" | grep -v grep |
awk '{print $1}'`
     exit 0
     ;;
  1) # If only one was running then it can be killed using the pid
     kill -${SIG} $1
     exit 0
     ;;
  *) # More than one! Aieehh.. We have to use ps to figure it out.
     # If no arguments were specified, then assume the 'provider' default.
     PID=`ps axw | egrep "pppd call ${PROVIDER:-provider}[[:space:]]*\$" |
grep -v grep | awk '{print $1}'`
     if [ $PID ]; then
        kill -${SIG} ${PID}
        exit 0
     else
        echo "I could not find a pppd process or provider
'${PROVIDER:-provider}'. None ${DONE}"
        exit 1
     fi
     ;;
esac

Here's man pon:

NAME
       pon,  poff,  plog  - startup, shutdown, or list the log of
       the PPP connection.

SYNOPSIS
       pon
       poff
       plog

DESCRIPTION
       pon and  poff  switch  the  ppp  connection  on  and  off.
       Progress  and  logged events related to the ppp connection
       can be viewed using plog

REQUIREMENTS FOR the p-commands to work
       /etc/ppp.chatscript
               must contain the correct chatscript to connect  to
               your  provider.  All users that are supposed to be
               able to use the p-commands should have read access
               to this file.

       /etc/ppp.options_out
               contains  the  options  for ppp to connect to your
               provider. This file also must be readable  by  all
               users who should be able to use the p-commands.

FILES
       /etc/ppp.chatscript
       /etc/ppp.options_out
       /etc/ppp/options
      /var/log/ppp.log
      /etc/ppp/pap-secrets
      /etc/ppp/chap-secrets

SEE ALSO
       pppd(8), chat(8), and the documentation in /usr/doc/ppp

AUTHOR
       The  p-commands  were written by Christoph Lameter <clame�
       [EMAIL PROTECTED]>


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, August 07, 2000 11:25 AM
Subject: Re: ppp working


> I meant, what does it do.  It is probably a 2 line shell script file you
> could list with
>
> cat $(which poff)
>
> I don't have pon, poff, ppp-off, nor man pages for them.  poff is
> probably exactly kill-blah-blah, but if the blah-blah includes -KILL or
> -9 the target pid will die immediately without getting a chance to
> remove its pid file or lock file.
>
> On Mon, 7 Aug 2000, davidturetsky wrote:
>
> > Makes a ppp connection
> >
> > check man pon
> >
> > poff seems to be the functional equivalent of KILL-blah-blah...
> >
> > They both appear to break the connection with an authentic click of the
> > modem relay




-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to