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`



Relevant Pages

  • Re: adding a ppp default gw while a eth0 default gw exist
    ... some distributions such as Debian provide a pppd with a patch that ... existing default route. ... listens to a routing socket or otherwise does something more PPP-agnostic? ... what a routing socket is) but I can write a shell script that performs ...
    (comp.protocols.ppp)
  • Re: dialup solution (as seconary connection / iptables )
    ... ip-down is launched by pppd only after the PPP link no longer available ... first with MINICOM or is PAP and script not mutualy exclusive? ... do have to "make the connection first with MINICOM." ... If you use the Linux box and route the news IP address to it on each ...
    (comp.os.linux.networking)
  • Re: pppd pty equivilent in FBSD
    ... I let pppd manage retries & setting routes. ... >I wouldn't personally recommend vpn over ssh for anyone either, ... I'm the sole bsd user at my company, and the ppp over ssh ... >Actual bash script I call: ...
    (freebsd-net)
  • Re: PPTP client, masquerade and routing
    ... # name of primary network interface (before tunnel) ... # provided by pppd: string to identify connection aka ipparam option ... route add -host $dev $ ...
    (comp.os.linux.networking)
  • Re: UMTS
    ... pppd can now operate in a mode where it doesn't request ... and still route traffic over it. ... doesn't stop the peer from asking you to authenticate to it. ...
    (comp.os.linux.networking)