Killing specific pid, automaticaly

From: MetaL (dpekic_at_barok.foi.hr)
Date: 03/29/04


Date: Mon, 29 Mar 2004 14:04:57 +0200

Hi,

I have this script,

pppd call LINK
route add default gw 192.168.1.62
fetchnews

and after the fetchnews command finishes i want to kill the pppd to
terminate the conection (its a VPN client).

How can i script this....???
i had an idea like this one

i need some way to memorise the pid of pppd
and then use kill -2 <that pid> to terminate the conection

but how can i get the pid every time?

thanx


Quantcast