stop.sh 266 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. DIRECTORY=`dirname $0`
  3. echo $DIRECTORY
  4. DIR=$DIRECTORY
  5. if [ "$DIR" == "" ] ; then
  6. HOME=$(pwd)
  7. else
  8. HOME=$DIR
  9. fi
  10. PIDFILE=$HOME/pid
  11. if [ -f $PIDFILE ] ; then
  12. kill `cat $PIDFILE`
  13. rm $PIDFILE
  14. echo "stop"
  15. else
  16. echo "Error: unable to find pid file"
  17. fi