X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=NeXT%2FExamples%2Fpppdown;fp=NeXT%2FExamples%2Fpppdown;h=c35471f53241cc0541f72d4c6301bba9702ae061;hb=b5c0cf380b11e37f580e6f2affcb78d5ccedade0;hp=0000000000000000000000000000000000000000;hpb=c178bf94c8aa2e30d3934dde8b5371d05ad41f7e;p=ppp.git diff --git a/NeXT/Examples/pppdown b/NeXT/Examples/pppdown new file mode 100644 index 0000000..c35471f --- /dev/null +++ b/NeXT/Examples/pppdown @@ -0,0 +1,18 @@ +#!/bin/sh +# +# This script fill find processes with 'pppd' in the name +# and send them SIGINT. It must be run suid root to work +# correctly. Some people don't like suid root shell scripts. +# In that case, check out the example pppkill.c which contains a +# C program that does the same thing. This might be a bit safer +# to make suid root. +# +# Note: there is the potential that this script can kill more than +# one process. Maybe even an incorrect process. It could +# probably be done better. +# + +PATH=/usr/ucb:/bin:/usr/bin:/etc:/usr/etc:/usr/local/bin; export PATH + +kill -INT `ps -ax | egrep "(pppd)" | egrep -v "egrep" | sed 's/^\([ 0-9]*\) .*/\1'/` +exit 0