summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJason St. John <jstjohn@purdue.edu>2011-10-14 00:08:14 -0400
committerPaul Mackerras <paulus@samba.org>2012-05-20 16:48:40 +1000
commit18f515f32c9f5723a9c2c912601e04335106534b (patch)
tree537631b2fc30b37312a283e52aa8c78db3bddcc2 /scripts
parent08ef47ca532294eb428238c831616748940e24a2 (diff)
downloadppp-18f515f32c9f5723a9c2c912601e04335106534b.tar.gz
scripts: Make poff ignore extra arguments to pppd
This allows /usr/bin/poff to properly end a /usr/sbin/pppd process that was started with additional arguments. The problem with the current poff script is on line 93 where the output of `ps axw` is piped into grep. The current regular expression that grep searches for prevents the PID of the specified pppd process from being found, which results in the script failing to terminate the pppd process. The output of poff in that case would be the following: /usr/bin/poff: I could not find a pppd process for provider 'cit-vpn'. None stopped. The reason for this is that the " *\$" at the end of the regular expression does not match the output of the following example from `ps axw`: 11846 ? Ss 0:00 /usr/sbin/pppd call cit-vpn updetach persist To resolve this issue, I removed the troublesome part of the regular expression (" *\$") and now grep can properly match the example output provided above. I have tested this using ppp 2.4.5-2 in conjunction with pptpclient-1.7.2-3 on Arch Linux x86_64. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/poff2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/poff b/scripts/poff
index 659bfa7..3f55a7f 100644
--- a/scripts/poff
+++ b/scripts/poff
@@ -91,7 +91,7 @@ if test "$#" -eq 0 -o "$MODE" = "all" ; then
fi
# There is an argument, so kill the pppd started on that provider.
-PID=`ps axw | grep "[ /]pppd call $1 *\$" | awk '{print $1}'`
+PID=`ps axw | grep "[ /]pppd call $1" | awk '{print $1}'`
if test -n "$PID" ; then
$KILL -$SIG $PID || {
echo "$0: $KILL failed. None ${DONE}."