Lines 6-25
Link Here
|
6 |
# |
6 |
# |
7 |
# Sets up the dependancies for the module |
7 |
# Sets up the dependancies for the module |
8 |
pppd_depend() { |
8 |
pppd_depend() { |
9 |
after interface |
9 |
after interface |
10 |
before dhcp |
10 |
before dhcp |
11 |
provide ppp |
11 |
provide ppp |
12 |
} |
12 |
} |
13 |
|
13 |
|
14 |
# bool pppd_check_installed(void) |
14 |
# bool pppd_check_installed(void) |
15 |
# |
15 |
# |
16 |
# Returns 1 if pppd is installed, otherwise 0 |
16 |
# Returns 1 if pppd is installed, otherwise 0 |
17 |
pppd_check_installed() { |
17 |
pppd_check_installed() { |
18 |
if [[ ! -x /usr/sbin/pppd ]]; then |
18 |
if [[ ! -x /usr/sbin/pppd ]]; then |
19 |
${1:-false} && eerror "For PPP support, emerge net-dialup/ppp" |
19 |
${1:-false} && eerror "For PPP support, emerge net-dialup/ppp" |
20 |
return 1 |
20 |
return 1 |
21 |
fi |
21 |
fi |
22 |
return 0 |
22 |
return 0 |
23 |
} |
23 |
} |
24 |
|
24 |
|
25 |
# char *pppd_regex_escape(char *string) |
25 |
# char *pppd_regex_escape(char *string) |
Lines 29-53
Link Here
|
29 |
# This may be a candidate for adding to /sbin/functions.sh or |
29 |
# This may be a candidate for adding to /sbin/functions.sh or |
30 |
# net-scripts functions at some point |
30 |
# net-scripts functions at some point |
31 |
pppd_regex_escape() { |
31 |
pppd_regex_escape() { |
32 |
local escaped_result="$*" |
32 |
local escaped_result="$*" |
33 |
escaped_result=${escaped_result//\\/\\\\} |
33 |
escaped_result=${escaped_result//\\/\\\\} |
34 |
escaped_result=${escaped_result//./\\.} |
34 |
escaped_result=${escaped_result//./\\.} |
35 |
escaped_result=${escaped_result//+/\\+} |
35 |
escaped_result=${escaped_result//+/\\+} |
36 |
escaped_result=${escaped_result//(/\\(} |
36 |
escaped_result=${escaped_result//(/\\(} |
37 |
escaped_result=${escaped_result//)/\\)} |
37 |
escaped_result=${escaped_result//)/\\)} |
38 |
escaped_result=${escaped_result//[/\\[} |
38 |
escaped_result=${escaped_result//[/\\[} |
39 |
escaped_result=${escaped_result//]/\\]} |
39 |
escaped_result=${escaped_result//]/\\]} |
40 |
escaped_result=${escaped_result//\{/\\\{} |
40 |
escaped_result=${escaped_result//\{/\\\{} |
41 |
escaped_result=${escaped_result//\}/\\\}} |
41 |
escaped_result=${escaped_result//\}/\\\}} |
42 |
escaped_result=${escaped_result//\?/\\\?} |
42 |
escaped_result=${escaped_result//\?/\\\?} |
43 |
escaped_result=${escaped_result//\*/\\\*} |
43 |
escaped_result=${escaped_result//\*/\\\*} |
44 |
escaped_result=${escaped_result//\//\\/} |
44 |
escaped_result=${escaped_result//\//\\/} |
45 |
escaped_result=${escaped_result//|/\\|} |
45 |
escaped_result=${escaped_result//|/\\|} |
46 |
escaped_result=${escaped_result//&/\\&} |
46 |
escaped_result=${escaped_result//&/\\&} |
47 |
escaped_result=${escaped_result//~/\\~} |
47 |
escaped_result=${escaped_result//~/\\~} |
48 |
escaped_result=${escaped_result//^/\\^} |
48 |
escaped_result=${escaped_result//^/\\^} |
49 |
escaped_result=${escaped_result//$/\\$} |
49 |
escaped_result=${escaped_result//$/\\$} |
50 |
echo $escaped_result |
50 |
echo $escaped_result |
51 |
} |
51 |
} |
52 |
|
52 |
|
53 |
# bool pppd_update_secrets_file(char* filepath, char* username, \ |
53 |
# bool pppd_update_secrets_file(char* filepath, char* username, \ |
Lines 55-98
Link Here
|
55 |
# |
55 |
# |
56 |
# Add/update PAP/CHAP authentication information |
56 |
# Add/update PAP/CHAP authentication information |
57 |
pppd_update_secrets_file() { |
57 |
pppd_update_secrets_file() { |
58 |
local filepath="$1" username="$2" remotename="$3" password="$4" |
58 |
local filepath="$1" username="$2" remotename="$3" password="$4" |
59 |
if [[ ! -f ${filepath} ]]; then |
59 |
if [[ ! -f ${filepath} ]]; then |
60 |
touch ${filepath} && \ |
60 |
touch ${filepath} && \ |
61 |
chmod 0600 ${filepath} || \ |
61 |
chmod 0600 ${filepath} || \ |
62 |
return 1 |
62 |
return 1 |
63 |
fi |
63 |
fi |
64 |
|
|
|
65 |
#escape username and remotename, used in following sed calls |
66 |
local regex_username=$(pppd_regex_escape ${username}) |
67 |
local regex_remotename=$(pppd_regex_escape ${remotename}) |
68 |
local regex_password |
69 |
local regex_filter="[ \t]*\"?${regex_username}\"?[ \t]*\"?${regex_remotename}\"?[ \t]*" |
70 |
|
71 |
#read old password, including " chars |
72 |
#for being able to distinct when we need to add or update auth info |
73 |
local old_password=$( |
74 |
sed -r -e "/^${regex_filter}\".*\"[ \t]*\$/\ |
75 |
{s/^${regex_filter}(\".*\")[ \t]*\$/\1/;q;};\ |
76 |
d;" \ |
77 |
${filepath} |
78 |
) |
79 |
|
64 |
|
80 |
if [[ -z "${old_password}" ]]; then |
65 |
#escape username and remotename, used in following sed calls |
81 |
regex_username=${username//\\/\\\\} |
66 |
local regex_username=$(pppd_regex_escape ${username}) |
82 |
regex_remotename=${remotename//\\/\\\\} |
67 |
local regex_remotename=$(pppd_regex_escape ${remotename}) |
83 |
regex_password=${password//\\/\\\\} |
68 |
local regex_password |
84 |
regex_password=${password//"/\\"} |
69 |
local regex_filter="[ \t]*\"?${regex_username}\"?[ \t]*\"?${regex_remotename}\"?[ \t]*" |
85 |
sed -r -i -e "\$a\"${regex_username}\" ${regex_remotename} \"${regex_password}\"" ${filepath} |
70 |
|
86 |
vewarn "Authentication info has been added to ${filepath}" |
71 |
#read old password, including " chars |
87 |
elif [[ "\"${password//\"/\\\"}\"" != "${old_password}" ]]; then |
72 |
#for being able to distinct when we need to add or update auth info |
88 |
regex_password=${password//\\/\\\\} |
73 |
local old_password=$( |
89 |
regex_password=${regex_password//\//\\/} |
74 |
sed -r -e "/^${regex_filter}\".*\"[ \t]*\$/\ |
90 |
regex_password=${regex_password//&/\\&} |
75 |
{s/^${regex_filter}(\".*\")[ \t]*\$/\1/;q;};\ |
91 |
regex_password=${regex_password//\"/\\\\\"} |
76 |
d;" \ |
92 |
sed -r -i -e "s/^(${regex_filter}\").*(\"[ \t]*)\$/\1${regex_password}\2/" ${filepath} |
77 |
${filepath} |
93 |
vewarn "Authentication info has been updated in ${filepath}" |
78 |
) |
94 |
fi |
79 |
|
95 |
return 0 |
80 |
if [[ -z "${old_password}" ]]; then |
|
|
81 |
regex_username=${username//\\/\\\\} |
82 |
regex_remotename=${remotename//\\/\\\\} |
83 |
regex_password=${password//\\/\\\\} |
84 |
regex_password=${password//"/\\"} |
85 |
sed -r -i -e "\$a\"${regex_username}\" ${regex_remotename} \"${regex_password}\"" ${filepath} |
86 |
vewarn "Authentication info has been added to ${filepath}" |
87 |
elif [[ "\"${password//\"/\\\"}\"" != "${old_password}" ]]; then |
88 |
regex_password=${password//\\/\\\\} |
89 |
regex_password=${regex_password//\//\\/} |
90 |
regex_password=${regex_password//&/\\&} |
91 |
regex_password=${regex_password//\"/\\\\\"} |
92 |
sed -r -i -e "s/^(${regex_filter}\").*(\"[ \t]*)\$/\1${regex_password}\2/" ${filepath} |
93 |
vewarn "Authentication info has been updated in ${filepath}" |
94 |
fi |
95 |
return 0 |
96 |
} |
96 |
} |
97 |
|
97 |
|
98 |
# bool pppd_start(char *iface) |
98 |
# bool pppd_start(char *iface) |
Lines 101-240
Link Here
|
101 |
# |
101 |
# |
102 |
# Returns 0 (true) when successful, otherwise 1 |
102 |
# Returns 0 (true) when successful, otherwise 1 |
103 |
pppd_start() { |
103 |
pppd_start() { |
104 |
local iface="$1" ifvar=$( bash_variable "$1" ) opts="" link |
104 |
${IN_BACKGROUND} && return 0 |
105 |
if [[ ${iface%%[0-9]*} != "ppp" ]]; then |
|
|
106 |
eerror "PPP can only be invoked from net.ppp[0-9]" |
107 |
return 1 |
108 |
fi |
109 |
|
105 |
|
110 |
local unit="${iface#ppp}" |
106 |
local iface="$1" ifvar=$( bash_variable "$1" ) opts="" link |
111 |
if [[ -z ${unit} ]] ; then |
107 |
if [[ ${iface%%[0-9]*} != "ppp" ]]; then |
112 |
eerror "PPP requires a unit - use net.ppp[0-9] instead of net.ppp" |
108 |
eerror "PPP can only be invoked from net.ppp[0-9]" |
113 |
return 1 |
109 |
return 1 |
114 |
fi |
110 |
fi |
115 |
|
111 |
|
116 |
# PPP requires a link to communicate over - normally a serial port |
112 |
local unit="${iface#ppp}" t |
117 |
# PPPoE communicates over ethernet |
113 |
if [[ -z ${unit} ]] ; then |
118 |
# PPPoA communictes over ATM |
114 |
eerror "PPP requires a unit - use net.ppp[0-9] instead of net.ppp" |
119 |
# In all cases, the link needs to be available before we start PPP |
115 |
return 1 |
120 |
eval link=\"\$\{link_${ifvar}\}\" |
116 |
fi |
121 |
if [[ -z ${link} ]]; then |
|
|
122 |
eerror "link_${ifvar} has not been set in /etc/conf.d/net" |
123 |
return 1 |
124 |
fi |
125 |
|
117 |
|
126 |
# Might or might not be set in conf.d/net |
118 |
# PPP requires a link to communicate over - normally a serial port |
127 |
local user password i |
119 |
# PPPoE communicates over Ethernet |
128 |
eval username=\"\$\{username_${ifvar}\}\" |
120 |
# PPPoA communicates over ATM |
129 |
eval password=\"\$\{password_${ifvar}\}\" |
121 |
# In all cases, the link needs to be available before we start PPP |
|
|
122 |
t="link_${ifvar}" |
123 |
link="${!t}" |
124 |
if [[ -z ${link} ]]; then |
125 |
eerror "link_${ifvar} has not been set in /etc/conf.d/net" |
126 |
return 1 |
127 |
fi |
130 |
|
128 |
|
131 |
#Add/update info in PAP/CHAP secrets files |
129 |
# Might or might not be set in conf.d/net |
132 |
if [[ -n ${username} && -n ${password} ]]; then |
130 |
local user password i opts |
133 |
for i in chap pap ; do |
131 |
t="username_${ifvar}" |
134 |
if ! pppd_update_secrets_file "/etc/ppp/${i}-secrets" \ |
132 |
username="${!t}" |
135 |
"${username}" "${iface}" "${password}" ; then |
133 |
t="password_${ifvar}" |
136 |
eerror "Failed to update /etc/ppp/${i}-secrets" |
134 |
password="${!t}" |
137 |
return 1 |
|
|
138 |
fi |
139 |
done |
140 |
fi |
141 |
|
135 |
|
142 |
# Load any commandline options |
136 |
#Add/update info in PAP/CHAP secrets files |
143 |
eval opts=\"\$\{pppd_${ifvar}\[@\]}\" |
137 |
if [[ -n ${username} && -n ${password} ]]; then |
|
|
138 |
for i in chap pap ; do |
139 |
if ! pppd_update_secrets_file "/etc/ppp/${i}-secrets" \ |
140 |
"${username}" "${iface}" "${password}" ; then |
141 |
eerror "Failed to update /etc/ppp/${i}-secrets" |
142 |
return 1 |
143 |
fi |
144 |
done |
145 |
fi |
144 |
|
146 |
|
145 |
# We don't work if unit, no detach or linkname is set. |
147 |
# Load any commandline options |
146 |
for i in unit nodetach linkname ; do |
148 |
t="pppd_${ifvar}[@]}" |
147 |
if [[ " ${opts} " == *" ${i} "* ]]; then |
149 |
opts=( "${!t}" ) |
148 |
eerror "The option \"${i}\" is not allowed" |
|
|
149 |
return 1 |
150 |
fi |
151 |
done |
152 |
|
150 |
|
153 |
# Check for mtu/mru |
151 |
# We don't work with these options set by the user |
154 |
local mtu |
152 |
for i in unit nodetach linkname maxfail persist ; do |
155 |
eval mtu=\"\$\{mtu_${ifvar}\}\" |
153 |
if [[ " ${opts[@]} " == *" ${i} "* ]]; then |
156 |
if [[ -n ${mtu} ]]; then |
154 |
eerror "The option \"${i}\" is not allowed" |
157 |
[[ " ${opts} " != *" mtu "* ]] && opts="${opts} mtu ${mtu}" |
155 |
return 1 |
158 |
[[ " ${opts} " != *" mru "* ]] && opts="${opts} mru ${mtu}" |
156 |
fi |
159 |
fi |
157 |
done |
160 |
|
158 |
|
161 |
# Set linkname because we need /var/run/ppp-${linkname}.pid |
159 |
# Check for mtu/mru |
162 |
# This pidfile has the advantage of being there, even if ${iface} interface was never started |
160 |
local mtu |
163 |
opts="linkname ${iface} ${opts}" |
161 |
mtu="mtu_${ifvar}" |
|
|
162 |
if [[ -n ${!mtu} ]]; then |
163 |
[[ " ${opts[@]} " != *" mtu "* ]] && opts=("${opts[@]}" mtu "${!mtu}") |
164 |
[[ " ${opts[@]} " != *" mru "* ]] && opts=("${opts[@]}" mru "${!mtu}") |
165 |
fi |
164 |
|
166 |
|
165 |
# Setup auth info |
167 |
# Set linkname because we need /var/run/ppp-${linkname}.pid |
166 |
[[ -n ${username} ]] && opts="user \"${username}\" ${opts}" |
168 |
# This pidfile has the advantage of being there, even if ${iface} interface was never started |
167 |
opts="remotename ${iface} ${opts}" |
169 |
opts=( linkname "${iface}" "${opts[@]}" ) |
168 |
|
170 |
|
169 |
# Load a custom interface configuration file if it exists |
171 |
# Setup auth info |
170 |
[[ -f "/etc/ppp/options.${iface}" ]] \ |
172 |
[[ -n ${username} ]] && opts=( user "${username}" "${opts[@]}" ) |
171 |
&& opts="${opts} file /etc/ppp/options.${iface}" |
173 |
opts=( remotename "${iface}" "${opts[@]}" ) |
172 |
|
174 |
|
173 |
# Set forced options |
175 |
# Load a custom interface configuration file if it exists |
174 |
opts="unit ${unit} persist maxfail 0 ${opts}" |
176 |
[[ -f "/etc/ppp/options.${iface}" ]] \ |
|
|
177 |
&& opts=( "${opts[@]}" file "/etc/ppp/options.${iface}" ) |
175 |
|
178 |
|
176 |
# Setup connect script |
179 |
# Set forced options |
177 |
local -a chat |
180 |
opts=( unit "${unit}" persist maxfail 0 "${opts[@]}" ) |
178 |
eval chat=( \"\$\{chat_${ifvar}\[@\]\}\" ) |
|
|
179 |
if [[ -n "${chat[@]}" ]]; then |
180 |
opts="${opts} connect \"/usr/sbin/chat -e -E -v" |
181 |
|
181 |
|
182 |
local -a phone_number |
182 |
# Setup connect script |
183 |
eval phone_number=( \"\$\{phone_number_${ifvar}\}\" ) |
183 |
local -a chat |
184 |
if [[ ${#phone_number[@]} -ge 1 ]]; then |
184 |
eval chat=( \"\$\{chat_${ifvar}\[@\]\}\" ) |
185 |
opts="${opts} -T '${phone_number[0]}'" |
185 |
if [[ -n "${chat[@]}" ]]; then |
186 |
if [[ ${#phone_number[@]} -ge 2 ]]; then |
186 |
local c="/usr/sbin/chat -e -E -v" |
187 |
opts="${opts} -U '${phone_number[1]}'" |
|
|
188 |
fi |
189 |
fi |
190 |
|
187 |
|
191 |
for (( i=0; i<${#chat[@]}; i++ )); do |
188 |
local -a phone_number |
192 |
opts="${opts} '${chat[i]}'" |
189 |
eval phone_number=( \"\$\{phone_number_${ifvar}\}\" ) |
193 |
done |
190 |
if [[ ${#phone_number[@]} -ge 1 ]]; then |
|
|
191 |
c="${c} -T '${phone_number[0]}'" |
192 |
if [[ ${#phone_number[@]} -ge 2 ]]; then |
193 |
c="${c} -U '${phone_number[1]}'" |
194 |
fi |
195 |
fi |
194 |
|
196 |
|
195 |
opts="${opts}\"" |
197 |
for (( i=0; i<${#chat[@]}; i++ )); do |
196 |
fi |
198 |
c="${c} '${chat[i]}'" |
|
|
199 |
done |
197 |
|
200 |
|
198 |
# Add plugins |
201 |
opts=( "${opts[@]}" "${c}" ) |
199 |
local -a plugins |
202 |
fi |
200 |
eval plugins=( \"\$\{plugins_${ifvar}\[@\]\}\" ) |
|
|
201 |
if [[ -n "${plugins[@]}" ]]; then |
202 |
for (( i=0; i<${#plugins[@]}; i++ )); do |
203 |
local -a plugin=( ${plugins[i]} ) |
204 |
# Bound to be some users who do this |
205 |
[[ ${plugin[0]} == "pppoe" ]] && plugin[0]="rp-pppoe" |
206 |
[[ ${plugin[0]} == "pppoa" ]] && plugin[0]="pppoatm" |
207 |
[[ ${plugin[0]} == "capi" ]] && plugin[0]="capiplugin" |
208 |
|
203 |
|
209 |
[[ ${plugin[0]} == "rp-pppoe" ]] && opts="${opts} connect true" |
204 |
# Add plugins |
210 |
opts="${opts} plugin ${plugin[0]}.so ${plugin[@]:1}" |
205 |
local -a plugins |
211 |
[[ ${plugin[0]} == "rp-pppoe" ]] && opts="${opts} ${link}" |
206 |
t="plugins_${ifvar}[@]" |
212 |
done |
207 |
plugins=( "${!t}" ) |
213 |
fi |
208 |
if [[ -n "${plugins[@]}" ]]; then |
|
|
209 |
for (( i=0; i<${#plugins[@]}; i++ )); do |
210 |
local -a plugin=( ${plugins[i]} ) |
211 |
# Bound to be some users who do this |
212 |
[[ ${plugin[0]} == "pppoe" ]] && plugin[0]="rp-pppoe" |
213 |
[[ ${plugin[0]} == "pppoa" ]] && plugin[0]="pppoatm" |
214 |
[[ ${plugin[0]} == "capi" ]] && plugin[0]="capiplugin" |
214 |
|
215 |
|
215 |
#Specialized stuff. Insert here actions particular to connection type (pppoe,pppoa,capi) |
216 |
[[ ${plugin[0]} == "rp-pppoe" ]] \ |
216 |
local insert_link_in_opts=1 |
217 |
&& opts=( "${opts[@]}" connect true ) |
217 |
if [[ " ${opts} " == *" plugin rp-pppoe.so "* ]]; then |
218 |
opts=( "${opts[@]}" plugin "${plugin[0]}.so" "${plugin[@]:1}" ) |
218 |
# Ensure that the link exists and is up |
219 |
[[ ${plugin[0]} == "rp-pppoe" ]] && opts=( "${opts[@]}" "${link}" ) |
219 |
interface_exists "${link}" true || return 1 |
220 |
done |
220 |
interface_up "${link}" |
221 |
fi |
221 |
|
222 |
|
222 |
# Load the pppoe kernel module - if this fails, we have to hope |
223 |
#Specialized stuff. Insert here actions particular to connection type (pppoe,pppoa,capi) |
223 |
# that pppoe support is compiled into the kernel |
224 |
local insert_link_in_opts=1 |
224 |
modprobe pppoe 2>/dev/null |
225 |
if [[ " ${opts[@]} " == *" plugin rp-pppoe.so "* ]]; then |
|
|
226 |
if [[ ! -e /proc/net/pppoe ]]; then |
227 |
# Load the PPPoE kernel module |
228 |
if ! modprobe pppoe ; then |
229 |
eerror "kernel does not support PPPoE" |
230 |
return 1 |
231 |
fi |
232 |
fi |
225 |
|
233 |
|
226 |
insert_link_in_opts=0 |
234 |
# Ensure that the link exists and is up |
227 |
fi |
235 |
interface_exists "${link}" true || return 1 |
228 |
[[ ${insert_link_in_opts} -eq 0 ]] || opts="${link} ${opts}" |
236 |
interface_up "${link}" |
229 |
|
|
|
230 |
ebegin "Running pppd" |
231 |
i=$( eval /usr/sbin/pppd ${opts} 2>&1 ) |
232 |
eend $? "${i}" || return 1 |
233 |
|
237 |
|
234 |
if [[ " ${opts} " == *" updetach "* ]]; then |
238 |
insert_link_in_opts=0 |
235 |
local addr=$( interface_get_address "${iface}" ) |
239 |
fi |
236 |
einfo "${iface} received address ${addr}" |
240 |
|
237 |
fi |
241 |
if [[ " ${opts[@]} " == *" plugin pppoatm.so "* ]]; then |
|
|
242 |
if [[ ! -d /proc/net/atm ]]; then |
243 |
# Load the PPPoA kernel module |
244 |
if ! modprobe pppoatm ; then |
245 |
eerror "kernel does not support PPPoATM" |
246 |
return 1 |
247 |
fi |
248 |
fi |
249 |
fi |
250 |
[[ ${insert_link_in_opts} -eq 0 ]] || opts="${link} ${opts}" |
251 |
|
252 |
ebegin "Running pppd" |
253 |
[[ " ${opts[@]} " != *" updetach "* ]] \ |
254 |
&& mark_service_inactive "net.${iface}" |
255 |
start-stop-daemon --start --exec /usr/sbin/pppd \ |
256 |
--pidfile "/var/run/ppp-${iface}.pid" -- "${opts[@]}" >/dev/null |
257 |
if [[ $? == 0 ]]; then |
258 |
eend 0 |
259 |
else |
260 |
eend $? |
261 |
mark_service_starting "net.${iface}" |
262 |
return 1 |
263 |
fi |
264 |
|
265 |
if [[ " ${opts[@]} " == *" updetach "* ]]; then |
266 |
local addr=$( interface_get_address "${iface}" ) |
267 |
einfo "${iface} received address ${addr}" |
268 |
else |
269 |
einfo "Backgrounding ..." |
270 |
exit 0 |
271 |
fi |
238 |
} |
272 |
} |
239 |
|
273 |
|
240 |
# bool pppd_stop(char *iface) |
274 |
# bool pppd_stop(char *iface) |
Lines 244-258
Link Here
|
244 |
# Returns 0 (true) if no process to kill or it terminates successfully, |
278 |
# Returns 0 (true) if no process to kill or it terminates successfully, |
245 |
# otherwise non-zero (false) |
279 |
# otherwise non-zero (false) |
246 |
pppd_stop() { |
280 |
pppd_stop() { |
247 |
local iface="$1" pidfile="/var/run/ppp-$1.pid" |
281 |
${IN_BACKGROUND} && return 0 |
|
|
282 |
local iface="$1" pidfile="/var/run/ppp-$1.pid" |
248 |
|
283 |
|
249 |
[[ ! -s ${pidfile} ]] && return 0 |
284 |
[[ ! -s ${pidfile} ]] && return 0 |
250 |
|
285 |
|
251 |
local pid |
286 |
einfo "Stopping pppd on ${iface}" |
252 |
read pid <"${pidfile}" #PID is the first line of the pidfile |
287 |
start-stop-daemon --stop --exec /usr/sbin/pppd --pidfile "${pidfile}" |
253 |
einfo "Stopping pppd on ${iface}" |
288 |
eend $? |
254 |
kill -s TERM "${pid}" |
|
|
255 |
process_finished "${pid}" /usr/sbin/pppd |
256 |
|
257 |
eend $? |
258 |
} |
289 |
} |
|
|
290 |
|
291 |
# vim: ts=4 |