diff options
author | Chuck Brewer <killian@gentoo.org> | 2003-04-24 07:57:39 +0000 |
---|---|---|
committer | Chuck Brewer <killian@gentoo.org> | 2003-04-24 07:57:39 +0000 |
commit | 47574788c12048b3ac0c2d442798f1a57ddf0b60 (patch) | |
tree | 6dcae56aafac9f50b7b55813175e59e8227f0a20 /net-dialup | |
parent | *** empty log message *** (diff) | |
download | historical-47574788c12048b3ac0c2d442798f1a57ddf0b60.tar.gz historical-47574788c12048b3ac0c2d442798f1a57ddf0b60.tar.bz2 historical-47574788c12048b3ac0c2d442798f1a57ddf0b60.zip |
more file shuffle
Diffstat (limited to 'net-dialup')
-rw-r--r-- | net-dialup/ppp/files/ip-up | 13 | ||||
-rw-r--r-- | net-dialup/ppp/files/plog | 7 | ||||
-rw-r--r-- | net-dialup/ppp/files/poff | 104 | ||||
-rwxr-xr-x | net-dialup/ppp/files/pon | 39 | ||||
-rw-r--r-- | net-dialup/ppp/files/pon.1 | 121 |
5 files changed, 284 insertions, 0 deletions
diff --git a/net-dialup/ppp/files/ip-up b/net-dialup/ppp/files/ip-up new file mode 100644 index 000000000000..8f950b4b8238 --- /dev/null +++ b/net-dialup/ppp/files/ip-up @@ -0,0 +1,13 @@ +#!/bin/sh + +# this is a script which is executed after connecting the ppp interface. +# look at man pppd for details + +# the followings parameters are available: +# $1 = interface-name +# $2 = tty-device +# $3 = speed +# $4 = local-IP-address +# $5 = remote-IP-address +# $6 = ipparam + diff --git a/net-dialup/ppp/files/plog b/net-dialup/ppp/files/plog new file mode 100644 index 000000000000..84d2c7340cc6 --- /dev/null +++ b/net-dialup/ppp/files/plog @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ -s /var/log/ppp.log ]; then + exec tail "$@" /var/log/ppp.log +else + exec tail "$@" /var/log/syslog | grep ' \(pppd\|chat\)\[' +fi diff --git a/net-dialup/ppp/files/poff b/net-dialup/ppp/files/poff new file mode 100644 index 000000000000..caa07ee84e0b --- /dev/null +++ b/net-dialup/ppp/files/poff @@ -0,0 +1,104 @@ +#!/bin/sh + +# $Id: poff,v 1.5 2003/04/24 07:57:39 killian Exp $ +# Written by John Hasler <john@dhh.gt.org> and based on work +# by Phil Hands <phil@hands.com>. Distributed under the GNU GPL + +if [ -x /usr/bin/kill ]; then + KILL="/usr/bin/kill" +else + KILL="/bin/kill" +fi +SIG=TERM +DONE="stopped" +MODE="" + +usage () +{ + cat <<!EOF! +usage: $0 [option] [provider] +options: + -r Cause pppd to drop the line and redial. + -d Toggle the state of pppd's debug option. + -c Cause pppd to renegotiate compression. + -a Stop all pppd's. 'provider' will be ignored. + -h Print this help summary and exit. + -v Print version and exit. + none Stop pppd. + +Options may not be combined. + +If 'provider' is omitted pppd will be stopped or signalled if and only if +there is exactly one running unless the '-a' option was given. If +'provider' is supplied the pppd controlling the connection to that +provider will be stopped or signalled. +!EOF! +} + +# Get option. If there are none replace the "?" that getopts puts in +# FLAG on error with "null". +getopts rdcavh FLAG +if [ "$?" -ne 0 ]; then + FLAG="null" +fi + +# Check for additional options. Should be none. +getopts :rdcavh DUMMY +if [ "$?" -eq 0 ]; then + echo "$0: Illegal option -- ${OPTARG}." + exit 1 +fi + +case $FLAG in + "r") SIG=HUP; DONE=signalled; shift ;; + "d") SIG=USR1; DONE=signalled; shift ;; + "c") SIG=USR2; DONE=signalled; shift ;; + "a") MODE="all"; shift ;; + "v") echo "$0$Revision: 1.5 $_TrickToPrint_RCS_Revision"; exit 0 ;; + "h") usage; exit 0 ;; + "?") exit 1; +esac + +# Get the PIDs of all the pppds running. Could also get these from +# /var/run, but pppd doesn't create .pid files until ppp is up. +PIDS=`pidof pppd` + +# poff is pointless if pppd isn't running. +if test -z "$PIDS"; then + echo "$0: No pppd is running. None ${DONE}." + exit 1 +fi + +# Find out how many pppd's are running. +N=`echo "$PIDS" | wc -w` + +# If there are no arguments we can't do anything if there is more than one +# pppd running. +if test "$#" -eq 0 -a "$N" -gt 1 -a $FLAG != "a" ; then + echo "$0: More than one pppd running and no "-a" option and +no arguments supplied. Nothing ${DONE}." + exit 1 +fi + +# If either there are no arguments or '-a' was specified kill all the +# pppd's. +if test "$#" -eq 0 -o "$MODE" = "all" ; then + $KILL -$SIG $PIDS || { + echo "$0: $KILL failed. None ${DONE}." + exit 1 + } + exit 0 +fi + +# There is an argument, so kill the pppd started on that provider. +PID=`ps axw | grep "[ /]pppd call $1 *\$" | awk '{print $1}'` +if test -n "$PID" ; then + $KILL -$SIG $PID || { + echo "$0: $KILL failed. None ${DONE}." + exit 1 + } +else + echo "$0: I could not find a pppd process for provider '$1'. None ${DONE}." + exit 1 +fi +exit 0 diff --git a/net-dialup/ppp/files/pon b/net-dialup/ppp/files/pon new file mode 100755 index 000000000000..12f97ffadf77 --- /dev/null +++ b/net-dialup/ppp/files/pon @@ -0,0 +1,39 @@ +#!/bin/sh + +case "$1" in + -*) echo " +Usage: pon [provider] [arguments] + +If pon is invoked without arguments, /etc/ppp/ppp_on_boot file will be +run, presuming it exists and is executable. Otherwise, a PPP connection +will be started using settings from /etc/ppp/peers/provider. +If you specify one argument, a PPP connection will be started using +settings from the appropriate file in the /etc/ppp/peers/ directory, and +any additional arguments supplied will be passed as extra arguments to +pppd. +" + exit 0 + ;; +esac + +if [ -z "$1" -a -x /etc/ppp/ppp_on_boot ]; then + exec /etc/ppp/ppp_on_boot +fi + +if [ -z "$1" -a ! -f /etc/ppp/peers/provider ]; then + echo " +Please configure /etc/ppp/peers/provider or use a command line argument to +use another file in /etc/ppp/peers/ directory. +" + exit 1 +fi + +if [ "$1" -a ! -f "/etc/ppp/peers/$1" ]; then + echo " +The file /etc/ppp/peers/$1 does not exist. +" + exit 1 +fi + +exec /usr/sbin/pppd call ${@:-provider} + diff --git a/net-dialup/ppp/files/pon.1 b/net-dialup/ppp/files/pon.1 new file mode 100644 index 000000000000..bb3220564b89 --- /dev/null +++ b/net-dialup/ppp/files/pon.1 @@ -0,0 +1,121 @@ +.\" This manual is published under the GPL. +.\" All guidelines specified in the GPL apply here. +.\" To get an ascii file: +.\" groff -man -Tascii pon.1 > pon.txt +.\" +.TH PON 1 "July 2000" "Debian Project" "Debian PPPD" +.SH NAME +pon, poff, plog \- starts up, shuts down or lists the log of PPP connections +.SH SYNOPSIS +.B pon +[ isp-name [ options ] ] +.br +.B poff +[ -r ] [ -d ] [ -c ] [ -a ] [ -h ] [ isp-name ] +.br +.B plog +[ arguments ] +.SH DESCRIPTION +This manual page describes the \fBpon\fP, \fBplog\fP and \fBpoff\fP +scripts, which allow users to control PPP connections. +.. +.SS pon +\fBpon\fP, invoked without arguments, runs the \fI/etc/ppp/ppp_on_boot\fP +file, if it exists and is executable. Otherwise, a PPP connection will be +started using configuration from \fI/etc/ppp/peers/provider\fP. +This is the default behaviour unless an \fBisp-name\fP argument is given. +.PP +For instance, to use ISP configuration "myisp" run: +.IP +pon myisp +.PP +\fBpon\fP will then use the options file \fI/etc/ppp/peers/myisp\fP. +You can pass additional \fBoptions\fP after the ISP name, too. +\fBpon\fP can be used to run multiple, simultaneous PPP connections. +.. +.SS poff +\fBpoff\fP closes a PPP connection. If more than one PPP connection exists, +the one named in the argument to \fBpoff\fP will be killed, e.g. +.IP +poff myprovider2 +.PP +will terminate the connection to myprovider2, and leave the PPP connections +to e.g. "myprovider1" or "myprovider3" up and running. +.PP +\fBpoff\fP takes the following command line options: +.RS +.TP +.B "\-r" +causes the connection to be redialed after it is dropped. +.TP +.B "\-d" +toggles the state of pppd's debug option. +.TP +.B "\-c" +causes +.BR pppd (8) +to renegotiate compression. +.TP +.B "\-a" +stops all running ppp connections. If the argument \fBisp-name\fP +is given it will be ignored. +.TP +.B "\-h" +displays help information. +.TP +.B "\-v" +prints the version and exits. +.PP +If no argument is given, \fBpoff\fP will stop or signal pppd if and only +if there is exactly one running. If more than one connection is active, +it will exit with an error code of 1. +.. +.SS plog +\fBplog\fP shows you the last few lines of \fI/var/log/ppp.log\fP. If that +file doesn't exist, it shows you the last few lines of your +\fI/var/log/syslog\fP file, but excluding the lines not generated by pppd. +This script makes use of the +.BR tail (1) +command, so arguments that can be passed to +.BR tail (1) +can also be passed to \fBplog\fP. +.PP +Note: the \fBplog\fP script can only be used by root or another system +administrator in group "adm", due to security reasons. Also, to have all +pppd-generated information in one logfile, that plog can show, you need the +following line in your \fI/etc/syslog.conf\fP file: +.PP +local2.* -/var/log/ppp.log +.RE +.SH FILES +.TP +.I /etc/ppp/options +PPPd system options file. +.TP +.I /etc/ppp/pap-secrets +System PAP passwords file. +.TP +.I /etc/ppp/chap-secrets +System CHAP passwords file. +.TP +.I /etc/ppp/peers/ +Directory holding the peer options files. The default file is called +\fIprovider\fP. +.TP +.I /etc/chatscripts/provider +The chat script invoked from the default \fI/etc/ppp/peers/provider\fP. +.TP +.I /var/log/ppp.log +The default PPP log file. +.SH AUTHORS +The p-commands were written by Christoph Lameter <clameter@debian.org>. +Updated and revised by Philip Hands <phil@hands.com>. +.br +This manual was written by Othmar Pasteka <othmar@tron.at>. Modified +by Rob Levin <lilo@openprojects.net>, with some extensions taken from +the old p-commands manual written by John Hasler <jhasler@debian.org>. +.SH "SEE ALSO" +.BR pppd (8), +.BR chat (8), +.BR tail (1). + |