startsim 681 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. NAME=sensorycancel
  3. PIDFILE=$NAME.pid
  4. stopsim()
  5. {
  6. if [ -f $PIDFILE ]
  7. then
  8. running=`ps aux | grep $NAME | grep $(cat $PIDFILE) -c`
  9. if [ $running -eq 0 ]
  10. then
  11. echo Simulation not running
  12. else
  13. echo Killing Simulation
  14. kill $(cat $PIDFILE)
  15. echo stoped Simulation
  16. fi
  17. rm $PIDFILE
  18. fi
  19. true
  20. }
  21. stopsim
  22. #nice -10 ./v4learn --LoadForwardWeights
  23. #nice -10 ./v4learn --LoadV4Weights
  24. if [ $# -gt 0 ] && [ $1 = "stop" ]
  25. then exit 0
  26. fi
  27. if [ -f nohup.out ]
  28. then
  29. echo remove nohup.out
  30. rm nohup.out
  31. fi
  32. nohup nice -10 ./$NAME $* &
  33. echo $! > $PIDFILE
  34. echo started simulation with parameters: $*