diff options
Diffstat (limited to 'packages/ppp/files')
-rw-r--r-- | packages/ppp/files/.mtn2git_empty | 0 | ||||
-rw-r--r-- | packages/ppp/files/08setupdns | 12 | ||||
-rw-r--r-- | packages/ppp/files/92removedns | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | packages/ppp/files/init | 50 | ||||
-rwxr-xr-x[-rw-r--r--] | packages/ppp/files/ip-down | 43 | ||||
-rwxr-xr-x[-rw-r--r--] | packages/ppp/files/ip-up | 44 | ||||
-rw-r--r-- | packages/ppp/files/poff | 26 | ||||
-rw-r--r-- | packages/ppp/files/pon | 9 |
8 files changed, 189 insertions, 0 deletions
diff --git a/packages/ppp/files/.mtn2git_empty b/packages/ppp/files/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/ppp/files/.mtn2git_empty diff --git a/packages/ppp/files/08setupdns b/packages/ppp/files/08setupdns index e69de29bb2..998219de97 100644 --- a/packages/ppp/files/08setupdns +++ b/packages/ppp/files/08setupdns @@ -0,0 +1,12 @@ +#!/bin/sh +ACTUALCONF=/var/run/resolv.conf +PPPCONF=/var/run/ppp/resolv.conf +if [ -f $PPPCONF ] ; then + if [ -f $ACTUALCONF ] ; then + if [ ! -h $ACTUALCONF -o ! "`readlink $ACTUALCONF 2>&1`" = "$PPPCONF" ] ; then + mv $ACTUALCONF $ACTUALCONF.ppporig + fi + fi + + ln -sf $PPPCONF $ACTUALCONF +fi diff --git a/packages/ppp/files/92removedns b/packages/ppp/files/92removedns index e69de29bb2..2eadec6899 100644 --- a/packages/ppp/files/92removedns +++ b/packages/ppp/files/92removedns @@ -0,0 +1,5 @@ +#!/bin/sh +ACTUALCONF=/var/run/resolv.conf +if [ -f $ACTUALCONF.ppporig ] ; then + mv $ACTUALCONF.ppporig $ACTUALCONF +fi diff --git a/packages/ppp/files/init b/packages/ppp/files/init index e69de29bb2..5b3b7abe2f 100644..100755 --- a/packages/ppp/files/init +++ b/packages/ppp/files/init @@ -0,0 +1,50 @@ +#!/bin/sh +# +# /etc/init.d/ppp: start or stop PPP link. +# +# If you want PPP started on boot time (most dialup systems won't need it) +# rename the /etc/ppp/no_ppp_on_boot file to /etc/ppp/ppp_on_boot, and +# follow the instructions in the comments in that file. + +test -x /usr/sbin/pppd -a -f /etc/ppp/ppp_on_boot || exit 0 +if [ -x /etc/ppp/ppp_on_boot ]; then RUNFILE=1; fi + +case "$1" in + start) + echo -n "Starting up PPP link: pppd" + if [ "$RUNFILE" = "1" ]; then + /etc/ppp/ppp_on_boot + else + pppd call provider + fi + echo "." + ;; + stop) + echo -n "Shutting down PPP link: pppd" + if [ "$RUNFILE" = "1" ]; then + poff + else + poff provider + fi + echo "." + ;; + restart|force-reload) + echo -n "Restarting PPP link: pppd" + if [ "$RUNFILE" = "1" ]; then + poff + sleep 5 + /etc/ppp/ppp_on_boot + else + poff provider + sleep 5 + pppd call provider + fi + echo "." + ;; + *) + echo "Usage: /etc/init.d/ppp {start|stop|restart|force-reload}" + exit 1 + ;; +esac + +exit 0 diff --git a/packages/ppp/files/ip-down b/packages/ppp/files/ip-down index e69de29bb2..06d35487a5 100644..100755 --- a/packages/ppp/files/ip-down +++ b/packages/ppp/files/ip-down @@ -0,0 +1,43 @@ +#!/bin/sh +# +# $Id: ip-down,v 1.2 1998/02/10 21:21:55 phil Exp $ +# +# This script is run by the pppd _after_ the link is brought down. +# It uses run-parts to run scripts in /etc/ppp/ip-down.d, so to delete +# routes, unset IP addresses etc. you should create script(s) there. +# +# Be aware that other packages may include /etc/ppp/ip-down.d scripts (named +# after that package), so choose local script names with that in mind. +# +# This script is called with the following arguments: +# Arg Name Example +# $1 Interface name ppp0 +# $2 The tty ttyS1 +# $3 The link speed 38400 +# $4 Local IP number 12.34.56.78 +# $5 Peer IP number 12.34.56.99 +# $6 Optional ``ipparam'' value foo + +# The environment is cleared before executing this script +# so the path must be reset +PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin +export PATH +# These variables are for the use of the scripts run by run-parts +PPP_IFACE="$1" +PPP_TTY="$2" +PPP_SPEED="$3" +PPP_LOCAL="$4" +PPP_REMOTE="$5" +PPP_IPPARAM="$6" +export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM + +# as an additional convenience, $PPP_TTYNAME is set to the tty name, +# stripped of /dev/ (if present) for easier matching. +PPP_TTYNAME=`/usr/bin/basename "$2"` +export PPP_TTYNAME + +# Main Script starts here + +run-parts /etc/ppp/ip-down.d + +# last line diff --git a/packages/ppp/files/ip-up b/packages/ppp/files/ip-up index e69de29bb2..fc2fae9fe0 100644..100755 --- a/packages/ppp/files/ip-up +++ b/packages/ppp/files/ip-up @@ -0,0 +1,44 @@ +#!/bin/sh +# +# $Id: ip-up,v 1.2 1998/02/10 21:25:34 phil Exp $ +# +# This script is run by the pppd after the link is established. +# It uses run-parts to run scripts in /etc/ppp/ip-up.d, so to add routes, +# set IP address, run the mailq etc. you should create script(s) there. +# +# Be aware that other packages may include /etc/ppp/ip-up.d scripts (named +# after that package), so choose local script names with that in mind. +# +# This script is called with the following arguments: +# Arg Name Example +# $1 Interface name ppp0 +# $2 The tty ttyS1 +# $3 The link speed 38400 +# $4 Local IP number 12.34.56.78 +# $5 Peer IP number 12.34.56.99 +# $6 Optional ``ipparam'' value foo + +# The environment is cleared before executing this script +# so the path must be reset +PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin +export PATH +# These variables are for the use of the scripts run by run-parts +PPP_IFACE="$1" +PPP_TTY="$2" +PPP_SPEED="$3" +PPP_LOCAL="$4" +PPP_REMOTE="$5" +PPP_IPPARAM="$6" +export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM + + +# as an additional convenience, $PPP_TTYNAME is set to the tty name, +# stripped of /dev/ (if present) for easier matching. +PPP_TTYNAME=`/usr/bin/basename "$2"` +export PPP_TTYNAME + +# Main Script starts here + +run-parts /etc/ppp/ip-up.d + +# last line diff --git a/packages/ppp/files/poff b/packages/ppp/files/poff index e69de29bb2..0521a9406a 100644 --- a/packages/ppp/files/poff +++ b/packages/ppp/files/poff @@ -0,0 +1,26 @@ +#!/bin/sh + +# 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. + killall pppd + ;; + 1) # If only one was running then it can be killed (apparently killall + # caused problems for some, so lets try killing the pid from the file) + kill $1 + ;; + *) # More than one! Aieehh.. Dont know which one to kill. + echo "More than one pppd running. None stopped" + exit 1 + ;; +esac + +if [ -r /var/run/ppp-quick ] +then + rm -f /var/run/ppp-quick +fi + +exit 0 diff --git a/packages/ppp/files/pon b/packages/ppp/files/pon index e69de29bb2..91c059501a 100644 --- a/packages/ppp/files/pon +++ b/packages/ppp/files/pon @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ "$1" = "quick" ] +then + touch /var/run/ppp-quick + shift +fi + +/usr/sbin/pppd call ${1:-provider} |