Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 26920 | Differences between
and this patch

Collapse All | Expand All

(-)net.ppp0.orig (-17 / +54 lines)
Lines 3-8 Link Here
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
# Author:  Martin Schlemmer <azarah@gentoo.org>
4
# Author:  Martin Schlemmer <azarah@gentoo.org>
5
# Credits:  To all those I got ideas from :)
5
# Credits:  To all those I got ideas from :)
6
# Modified by HS - (ver. 3)
6
# 
7
# 
7
# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/net.ppp0,v 1.14 2003/05/18 21:51:34 azarah Exp $
8
# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/net.ppp0,v 1.14 2003/05/18 21:51:34 azarah Exp $
8
9
Lines 25-31 Link Here
25
	if [ -e "/var/run/ppp-${IFACE}.pid" -o -e "/var/run/${IFACE}.pid" ] && \
26
	if [ -e "/var/run/ppp-${IFACE}.pid" -o -e "/var/run/${IFACE}.pid" ] && \
26
	   [ "${FUNCT}" = "start" ]
27
	   [ "${FUNCT}" = "start" ]
27
	then
28
	then
28
		eerror "ppp0 is already up"
29
		eerror "${IFACE} is already up"
29
		return 1
30
		return 1
30
	fi
31
	fi
31
}
32
}
Lines 61-83 Link Here
61
	if [ -x "$(which ifconfig)" ]
62
	if [ -x "$(which ifconfig)" ]
62
	then
63
	then
63
64
64
		if [ -z "$(/sbin/ifconfig | egrep "${IFACE}")" ]
65
		# Obtain interface name from pid file (IFACE is actually linkname)
66
		if [ -e /var/run/ppp-${IFACE}.pid ]
67
		then
68
			IFNAME=$(egrep "ppp" /var/run/ppp-${IFACE}.pid)
69
		fi
70
		if [ -z "${IFNAME}" ]
71
		then
72
			IFNAME=${IFACE}
73
		fi
74
75
		if [ -z "$(/sbin/ifconfig | egrep "${IFNAME}")" ]
65
		then
76
		then
77
78
			# Link is not up but pppd may be running
66
			ewarn "Interface seems to be down already"
79
			ewarn "Interface seems to be down already"
67
			# We should return 0 here, else svc_stop() will not remove
68
			# the 'started' symlink ...
69
			return 0
70
		fi
80
		fi
71
		
81
		
72
#		/sbin/ifconfig ${IFACE} down
82
#		/sbin/ifconfig ${IFACE} down
73
		if [ -e /var/run/ppp-${IFACE}.pid ]
83
		if [ -e /var/run/ppp-${IFACE}.pid ]
74
		then
84
		then
75
			kill $(egrep -v "${IFACE}" /var/run/ppp-${IFACE}.pid)
85
			PID=$(egrep -v "${IFNAME}" /var/run/ppp-${IFACE}.pid)
76
77
		elif [ -e /var/run/${IFACE}.pid ]
86
		elif [ -e /var/run/${IFACE}.pid ]
78
		then
87
		then
79
			kill $(egrep -v "${IFACE}" /var/run/${IFACE}.pid)
88
			PID=$(egrep -v "${IFNAME}" /var/run/${IFACE}.pid)
80
		fi
89
		fi
90
91
		if [ -n "${PID}" ]
92
		then
93
			kill ${PID}
94
			sleep 0.5
95
96
			# Check if pppd is not running (check it 10 times because pppd
97
			# sometimes do not finish so fast)
98
			PID=`pstree -p ${PID}`
99
			PID=`echo ${PID} | sed -e 's:^.*pppd(\|).*::g'`
100
			COUNT=0
101
			while [ -n "${PID}" ] && [ ${COUNT} -lt 10 ]
102
			do
103
				sleep 0.5
104
				PID=`pstree -p ${PID}`
105
				PID=`echo ${PID} | sed -e 's:^.*pppd(\|).*::g'`
106
				let COUNT++
107
			done
108
		fi
109
110
		if [ -n "${PID}" ]
111
		then
112
			eend 1 "Error stopping pppd"
113
		fi
114
81
	fi
115
	fi
82
	eend
116
	eend
83
}
117
}
Lines 163-178 Link Here
163
		chmod 600 /etc/ppp/pap-secrets
197
		chmod 600 /etc/ppp/pap-secrets
164
198
165
		# Setup the chat file
199
		# Setup the chat file
166
		if [ -n "${INITSTRING}" ]
200
		if [ "${AUTOCHATSCRIPT}" = "yes" ]
167
		then
201
		then
168
			sed -e "9i\\'OK\' \'${INITSTRING}\'" \
202
			if [ -n "${INITSTRING}" ]
169
				-e "s:\$NUMBER:${NUMBER}:" \
203
			then
170
				${TEMPLATEDIR}/chat-default \
204
				sed -e "9i\\'OK\' \'${INITSTRING}\'" \
171
				>/etc/ppp/chat-${PEER}
205
					-e "s:\$NUMBER:${NUMBER}:" \
172
		else
206
					${TEMPLATEDIR}/chat-default \
173
			sed -e "s:\$NUMBER:${NUMBER}:" \
207
					>/etc/ppp/chat-${PEER}
174
				${TEMPLATEDIR}/chat-default \
208
			else
175
				>/etc/ppp/chat-${PEER}
209
				sed -e "s:\$NUMBER:${NUMBER}:" \
210
					${TEMPLATEDIR}/chat-default \
211
					>/etc/ppp/chat-${PEER}
212
			fi
176
		fi
213
		fi
177
214
178
		# Setup the ip-scripts so long
215
		# Setup the ip-scripts so long

Return to bug 26920