All pastes #155855 Raw Edit

Unnamed

public text v1 · immutable
#155855 ·published 2006-08-31 11:42 UTC
rendered paste body
#!/bin/bash

CONFIGDIR=/home/Mr_Molez/ROTATION/conffilezzz
PIDFILE="$CONFIGDIR/r5156.pid"

if [ -z "$1" ] ; then
  echo "usage: $0 confname" >&2
  exit 1
fi
SERVERNAME="$CONFIGDIR/$1"
if [ ! -r $SERVERNAME ] ; then
  echo "Can't read $SERVERNAME" >&2
  exit 2
fi
#
if [ -r $PIDFILE ] ; then
#
        # get the PID into a variable
        pid=`cat $PIDFILE`
        # try to kill
        if kill $pid ; then
                # wait for process to finish
                while [ `ps -p $pid | wc -l` -gt 1 ] ; do
                        sleep 1
                done
        fi
#
fi
#
/home/Mr_Molez/ROTATION/bzfs -conf $SERVERNAME -pidfile $PIDFILE &