Re: Killing specific pid, automaticaly

From: whytewolf (whytewolf_at_techie.com)
Date: 03/31/04


Date: 31 Mar 2004 09:10:25 -0800


"MetaL" <dpekic@barok.foi.hr> wrote in message news:<c493eg$que$1@brown.net4u.hr>...
> 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

pppd call LINK &&
route add default gw 192.168.1.62 &&
fetchnews &&
kill -2 `pidof pppd`