summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lutgens <lamer@gentoo.org>2001-07-15 02:33:15 +0000
committerBen Lutgens <lamer@gentoo.org>2001-07-15 02:33:15 +0000
commitf7761d5981a2b0f21ac0ee7d6cb9c2e08035558e (patch)
treede26148b5a99ef87af4e100da7e736bf39fbd545 /net-dialup/ppp
parentputting it in /sbin, it's better there (diff)
downloadgentoo-2-f7761d5981a2b0f21ac0ee7d6cb9c2e08035558e.tar.gz
gentoo-2-f7761d5981a2b0f21ac0ee7d6cb9c2e08035558e.tar.bz2
gentoo-2-f7761d5981a2b0f21ac0ee7d6cb9c2e08035558e.zip
Added pppconfig and made it depend on ppp-2.4.1-r2 which contains a few
simple scripts to start and stop connections. If you want to allow users to run pon and poff themselves run the following as root chown -R root.dialout /etc/{chatscripts,ppp} chmod -R g+r /etc/{chatscripts,ppp} chown root.dialout /usr/sbin/pppd chown root.dialout /dev/ppp and then add the users you want to the dialout group. (don't think I left any perms changes out)
Diffstat (limited to 'net-dialup/ppp')
-rw-r--r--net-dialup/ppp/files/digest-ppp-2.4.1-r21
-rw-r--r--net-dialup/ppp/files/poff100
-rwxr-xr-xnet-dialup/ppp/files/pon2
-rw-r--r--net-dialup/ppp/files/pon.1179
-rw-r--r--net-dialup/ppp/ppp-2.4.1-r2.ebuild63
5 files changed, 345 insertions, 0 deletions
diff --git a/net-dialup/ppp/files/digest-ppp-2.4.1-r2 b/net-dialup/ppp/files/digest-ppp-2.4.1-r2
new file mode 100644
index 000000000000..d9bd23c07d7f
--- /dev/null
+++ b/net-dialup/ppp/files/digest-ppp-2.4.1-r2
@@ -0,0 +1 @@
+MD5 fbc256801d5fcd8015039b149ae95eb0 ppp-2.4.1.tar.gz
diff --git a/net-dialup/ppp/files/poff b/net-dialup/ppp/files/poff
new file mode 100644
index 000000000000..070a41f4c181
--- /dev/null
+++ b/net-dialup/ppp/files/poff
@@ -0,0 +1,100 @@
+#!/bin/sh
+
+# $Id: poff,v 1.1 2001/07/15 02:33:15 lamer Exp $
+# Written by John Hasler <john@dhh.gt.org> and based on work
+# by Phil Hands <phil@hands.com>. Distributed under the GNU GPL
+
+KILL="/bin/kill"
+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.1 $_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..e1ea50a59a93
--- /dev/null
+++ b/net-dialup/ppp/files/pon
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/sbin/pppd call ${1:-provider}
diff --git a/net-dialup/ppp/files/pon.1 b/net-dialup/ppp/files/pon.1
new file mode 100644
index 000000000000..8e2c2b50f94c
--- /dev/null
+++ b/net-dialup/ppp/files/pon.1
@@ -0,0 +1,179 @@
+.\" 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 "February 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
+.RB [ " isp-name " ]
+.br
+.B poff
+.RB [ " \-r " ]
+.RB [ " \-d " ]
+.RB [ " \-c " ]
+.RB [ " \-a " ]
+.RB [ " \-h " ]
+.B isp-name
+.br
+.B plog
+.RB [ " argument " ]
+.SH DESCRIPTION
+This manual page describes the \fBpon\fP, \fBpoff\fP and \fBplog\fP
+scripts, which allow users to control PPP connections.
+.PP
+.B pon
+starts a PPP connection to a provider, reading its configuration from
+.I /etc/ppp/peers/provider
+and using the chatscript
+.IR /etc/chatscripts/provider .
+This is the default setting if
+.B isp-name
+is not given.
+.PP
+To start a PPP connection to a different provider, specify an
+.B isp-name
+operand. For instance, to use provider configuration "provider2" run
+.IP
+pon provider2
+.PP
+The system will then use the chatscript
+.I /etc/chatscripts/provider2
+and the options file
+.IR "/etc/ppp/peers/provider2".
+You can use
+.B pon
+to run multiple, simultaneous PPP connections.
+.PP
+.B poff
+closes a PPP connection. If more than one PPP connection exists, the one named
+in the argument to
+.B poff
+will be killed, e.g.
+.IP
+poff myprovider2
+.PP
+will terminate the connection to myprovider2, and leave the PPP connection
+to "myprovider1" up and running.
+.PP
+.B plog
+shows you the last few lines of
+.IR /var/log/ppp.log .
+If that file doesn't exist, it shows you the last few lines of
+.IR /var/log/syslog
+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
+.B plog.
+.SH OPTIONS
+.SS Options for pon
+.TP
+.B isp-name
+is the name of the ISP connection to start. If no
+.B isp-name
+is specified,
+.B pon
+will use the name "provider".
+.SS Options for poff
+.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
+.B isp-name
+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 it will kill all ppp connections. Like the
+.B "\-a"
+option.
+.SS Options for plog
+.TP
+.B argument
+is any argument you can also pass to
+.BR tail (1).
+.SH REQUIREMENTS
+.BR pppd (8)
+must be installed and configured.
+.PP
+.I /etc/chatscripts/provider
+is the default chatscript, used when
+.B pon
+is invoked without an argument. Edit it to suit your needs. See
+.BR chat (8).
+.PP
+.I /etc/ppp/peers/provider
+is the default options file, used when
+.B pon
+is invoked without an argument. Edit it to suit your needs. See
+.BR pppd (8).
+.PP
+When
+.B pon
+is invoked with an
+.B isp-name
+argument, different filenames are used. For example, if
+.B isp-name
+"myprovider" is specified, chatscript
+.I /etc/chatscripts/myprovider
+and options file
+.IR /etc/ppp/peers/myprovider
+are used.
+.SH NOTE
+The
+.B plog
+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 /etc/syslog.conf file:
+.PP
+local2.* -/var/log/ppp.log
+.SH FILES
+.TP
+.I /etc/chatscripts/provider
+The default chat script.
+.TP
+.I /etc/ppp/peers/provider
+The default peer option file.
+.TP
+.I /etc/ppp/chap-secrets
+System CHAP passwords file.
+.TP
+.I /etc/ppp/pap-secrets
+System PAP passwords file.
+.TP
+.I /etc/ppp/options
+System PPP option file.
+.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> and 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 chat (8),
+.BR pppd (8),
+.BR tail (1).
diff --git a/net-dialup/ppp/ppp-2.4.1-r2.ebuild b/net-dialup/ppp/ppp-2.4.1-r2.ebuild
new file mode 100644
index 000000000000..52d04628c1c9
--- /dev/null
+++ b/net-dialup/ppp/ppp-2.4.1-r2.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2001 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# Author Daniel Robbins <drobbins@gentoo.org>
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/ppp/ppp-2.4.1-r2.ebuild,v 1.1 2001/07/15 02:33:15 lamer Exp $
+
+A="${P}.tar.gz"
+S=${WORKDIR}/${P}
+DESCRIPTION="Point-to-point protocol - used for communicating with your ISP"
+SRC_URI="ftp://cs.anu.edu.au/pub/software/ppp/${A}"
+
+DEPEND="virtual/glibc"
+
+src_compile() {
+ try ./configure --prefix=/usr
+ #fix Makefiles to compile optimized
+ cd pppd
+ mv Makefile Makefile.orig
+ sed -e "s:COPTS = -O2 -pipe -Wall -g:COPTS = ${CFLAGS}:" -e "s/LIBS =/LIBS = -lcrypt/" Makefile.orig > Makefile
+ cd ../pppstats
+ mv Makefile Makefile.orig
+ sed -e "s:COPTS = -O:COPTS = ${CFLAGS}:" Makefile.orig > Makefile
+ cd ../chat
+ mv Makefile Makefile.orig
+ sed -e "s:-O2:${CFLAGS}:" Makefile.orig > Makefile
+ cd ../pppdump
+ mv Makefile Makefile.orig
+ sed -e "s:CFLAGS= -O:CFLAGS= ${CFLAGS}:" Makefile.orig > Makefile
+ cd ..
+ export CC=gcc
+ try make
+}
+
+src_install() {
+ into /usr
+ for y in chat pppd pppdump pppstats
+ do
+ doman ${y}/${y}.8
+ dosbin ${y}/${y}
+ done
+ chmod u+s-w ${D}/usr/sbin/pppd
+ chown root:daemon ${D}/usr/sbin/pppstats
+ dodir /etc/ppp
+ insinto /etc/ppp
+ insopts -m0600
+ doins etc.ppp/pap-secrets etc.ppp/chap-secrets
+ insopts -m0644
+ doins etc.ppp/options
+ insinto /etc/modules
+ doins ${FILESDIR}/modules.ppp
+ dodoc PLUGINS README* SETUP Changes-2.3 FAQ
+ # Added a couple scripts to simplify dialing up
+ # borrowed from debian, man they got some nice little apps :-)
+ dosbin ${FILESDIR}/pon
+ dosbin ${FILESDIR}/poff
+ doman ${FILESDIR}/pon.1
+}
+
+pkg_postinst() {
+
+if [ ! -e /dev/ppp ]; then
+ mknod /dev/ppp c 108 0
+fi
+}