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