Scripts to start and stop

Adam Lang aalang at rutgersinsurance.com
Fri May 25 18:32:40 UTC 2001


Ok I got part of it working:
ps -aux | grep 'perl' | awk '{print $2}'

produces this at the command line
22224
28431

(the first number is the nanny program and the second is the grep)
But when I run this in the script:
$nanny_pids=`ps -aux | grep 'perl' | awk '{print $2}'`

I get:
./named: =22224: command not found

I placed an echo after that line to se if anything is in $nanny_pids, but it
echos a blank line.

I know this is not 100% BIND related, but I figured if I can get a working
script, it would be good for the archives to have.

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Brad Knowles" <brad.knowles at skynet.be>
To: "Adam Lang" <aalang at rutgersinsurance.com>
Cc: <bind-users at isc.org>
Sent: Friday, May 25, 2001 1:45 PM
Subject: Re: Scripts to start and stop


>
> At 1:36 PM -0400 5/25/01, Adam Lang wrote:
>
> >  so I would have soemthing like this:
> >
> >  $nanny_pid=`ps -aux | grep nanny.pl | awk '{print 2}'`  (would I need 2
in
> >  quotes?)
>
> This command could also catch the PID for the grep, too.  Even
> then, it could still return multiple PIDs.  I would instead suggest:
>
> $NANNY_PIDS=`ps -aux | egrep 'n[a]nny.pl' | awk '{ print $2}'`
> for PID in $NANNY_PIDS
> do
> kill -9 $PID
> done
>
> --
> Brad Knowles, <brad.knowles at skynet.be>
>
> /*        efdtt.c  Author:  Charles M. Hannum <root at ihack.net>          */
> /*       Represented as 1045 digit prime number by Phil Carmody         */
> /*     Prime as DNS cname chain by Roy Arends and Walter Belgers        */
> /*                                                                      */
> /*     Usage is:  cat title-key scrambled.vob | efdtt >clear.vob        */
> /*   where title-key = "153 2 8 105 225" or other similar 5-byte key    */
>
> dig decss.friet.org|perl -ne'if(/^x/){s/[x.]//g;print pack(H124,$_)}'



More information about the bind-users mailing list