summaryrefslogtreecommitdiff
path: root/net.Linux
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-04-19 10:52:37 +0000
committerRoy Marples <roy@marples.name>2007-04-19 10:52:37 +0000
commitc2407df288a5a602e0daea0c349889d265dd615d (patch)
tree6534c33abc07f85f19c8cc4b8ced72a1fc05ae49 /net.Linux
parent2fc28414fa72eaebfebf8665437537a9d81b3817 (diff)
downloadopenrc-c2407df288a5a602e0daea0c349889d265dd615d.tar.gz
openrc-c2407df288a5a602e0daea0c349889d265dd615d.tar.bz2
openrc-c2407df288a5a602e0daea0c349889d265dd615d.tar.xz
As pppd is mainly a link controller, move it's startup to pppd_pre_start and have pppd_start as a dummy function for old configs.
Diffstat (limited to 'net.Linux')
-rw-r--r--net.Linux/pppd.sh29
1 files changed, 15 insertions, 14 deletions
diff --git a/net.Linux/pppd.sh b/net.Linux/pppd.sh
index 3015404..2d1ded1 100644
--- a/net.Linux/pppd.sh
+++ b/net.Linux/pppd.sh
@@ -16,29 +16,20 @@ requote() {
printf "'%s' " "$@"
}
-pppd_start() {
+pppd_pre_start() {
${IN_BACKGROUND} && return 0
- if [ "${IFACE%%[0-9]*}" != "ppp" ] ; then
- eerror "PPP can only be invoked from net.ppp[0-9]"
- return 1
- fi
+ # Interface has to be called ppp
+ [ "${IFACE%%[0-9]*}" = "ppp" ] || return 0
local link= i= opts= unit="${IFACE#ppp}" mtu=
- if [ -z "${unit}" ] ; then
- eerror "PPP requires a unit - use net.ppp[0-9] instead of net.ppp"
- return 1
- fi
-
+
# PPP requires a link to communicate over - normally a serial port
# PPPoE communicates over Ethernet
# PPPoA communicates over ATM
# In all cases, the link needs to be available before we start PPP
eval link=\$link_${IFVAR}
- if [ -z "${link}" ] ; then
- eerror "link_${IFVAR} has not been set in /etc/conf.d/net"
- return 1
- fi
+ [ -n "${link}" ] || return 0
case "${link}" in
/*)
@@ -50,6 +41,11 @@ pppd_start() {
;;
esac
+ if [ -z "${unit}" ] ; then
+ eerror "PPP requires a unit - use net.ppp[0-9] instead of net.ppp"
+ return 1
+ fi
+
eval $(_get_array "pppd_${IFVAR}")
opts="$@"
@@ -199,6 +195,11 @@ pppd_start() {
exit 0
}
+# Dummy function for users that still have config_ppp0="ppp"
+pppd_start() {
+ return 0
+}
+
pppd_stop() {
${IN_BACKGROUND} && return 0
local pidfile="/var/run/ppp-${IFACE}.pid"