[mohaa] Server restart script

Luca Fabbro luca.fabbro at procne.it
Wed Aug 18 10:45:32 EDT 2004


Is this all on one line or did il returns after gawk?

ps auxwww | grep $PROG | grep $PORT | grep $CONFIG | grep -v grep | gawk 
'{print $2}' | xargs kill

It should be all on one line no carriage return in the middle

At 16.30 18/08/2004, you wrote:
>Its still the same output and doesnt kill the server?
>
>#Put here path to config file
>/root/serverconfig.sh
>#Searches for pid of server
>ps auxwww | grep $PROG | grep $PORT | grep $CONFIG | grep -v grep | gawk
>'{print $2}' | xargs kill
>#Checks kill exit status
>if [ 0 != $? ]
>then
>      echo "Server Down"
>else
>      echo "Server Killed"
>fi
>
>----- Original Message -----
>From: "Luca Fabbro" <luca.fabbro at procne.it>
>To: <mohaa at icculus.org>
>Sent: Wednesday, August 18, 2004 3:14 PM
>Subject: Re: [mohaa] Server restart script
>
>
> > Put the . before /root/serverconfig.sh
> >
> > #Put here path to config file
> > . /root/serverconfig.sh
> >
> > Think that in this way should work
> >
> > Ciao
> >          Luca
> >
> > At 16.02 18/08/2004, you wrote:
> > >Ok that woks :D thanks
> > >
> > >but the kill scripts doesnt :(
> > >
> > >My Script is
> > >serverkill.sh:
> > >
> > >#Put here path to config file
> > >  /root/serverconfig.sh
> > >#Searches for pid of server
> > >ps auxwww | grep $PROG | grep $PORT | grep $CONFIG | grep -v grep | gawk
> > >'{print $2}' | xargs kill
> > >#Checks kill exit status
> > >if [ 0 != $? ]
> > >then
> > >      echo "Server Down"
> > >else
> > >      echo "Server Killed"
> > >fi
> > >
> > >When i run the cmd ./serverkill.sh
> > >
> > >i get this output
> > >
> > >Usage: gawk [POSIX or GNU style options] -f progfile [--] file ...
> > >Usage: gawk [POSIX or GNU style options] [--] 'program' file ...
> > >POSIX options:          GNU long options:
> > >         -f progfile             --file=progfile
> > >         -F fs                   --field-separator=fs
> > >         -v var=val              --assign=var=val
> > >         -m[fr] val
> > >         -W compat               --compat
> > >         -W copyleft             --copyleft
> > >         -W copyright            --copyright
> > >         -W dump-variables[=file]        --dump-variables[=file]
> > >         -W gen-po               --gen-po
> > >         -W help                 --help
> > >         -W lint[=fatal]         --lint[=fatal]
> > >         -W lint-old             --lint-old
> > >         -W non-decimal-data     --non-decimal-data
> > >         -W profile[=file]       --profile[=file]
> > >         -W posix                --posix
> > >         -W re-interval          --re-interval
> > >         -W source=program-text  --source=program-text
> > >         -W traditional          --traditional
> > >         -W usage                --usage
> > >         -W version              --version
> > >
> > >To report bugs, see node `Bugs' in `gawk.info', which is
> > >section `Reporting Problems and Bugs' in the printed version.
> > >
> > >gawk is a pattern scanning and processing language.
> > >By default it reads standard input and writes standard output.
> > >
> > >Examples:
> > >         gawk '{ sum += $1 }; END { print sum }' file
> > >         gawk -F: '{ print $1 }' /etc/passwd
> > >/serverkill.sh: line 5: {print $2}: command not found
> > >usage: kill [ -s signal | -p ] [ -a ] pid ...
> > >        kill -l [ signal ]
> > >Server Down
> > >
> > >
> > >Any Ideas?
> > >----- Original Message -----
> > >From: "Luca Fabbro" <luca.fabbro at procne.it>
> > >To: <mohaa at icculus.org>
> > >Sent: Wednesday, August 18, 2004 2:50 PM
> > >Subject: Re: [mohaa] Server restart script
> > >
> > >
> > > > In the start script put this lines back, don't need to change them in
>that
> > > > script
> > > >
> > > > #Check for a specific IP to set
> > > > if [ "$IP" == "" ]
> > > > then
> > > >   IPS=""
> > > > else
> > > >   IPS=" +set net_IP $IP"
> > > > fi
> > > >
> > > > You need to specify the IP to listen only if you have multiples ip on
> > >machine
> > > > I think that you don't need it
> > > > If you need it simply add this line in in your serverconfig.sh
> > > >
> > > > #My listen ETH ip
> > > > IP="67.18.236.202"
> > > >
> > > > Let me know
> > > >          Luca
> > > >
> > > > At 15.34 18/08/2004, you wrote:
> > > > >Ok thanks that works, but now its only starting as a LAN server, My
>lines
> > > > >with IP info is
> > > >
> > > >
> >
> >




More information about the Mohaa mailing list