Advertisement
vojtarek

test.sh version 1

Sep 14th, 2011
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.79 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. out=`ssh merlin "ssh athena \"ps U xrylko00\""`
  3.  
  4. IFS=$'\n' ### changes break point for arrays!!! no break on spaces
  5. kws=(
  6. "calaised.py 0"
  7. "calaised.py 100"
  8. stanfordtoinstances.py)
  9.  
  10. ok=0
  11. for kw in ${kws[*]}
  12. do
  13.     if [[ $out != *$kw* ]]
  14.     then
  15.         echo "ERROR ($kw)"
  16.         ok+=1
  17.     else
  18.         echo "OK ($kw)"
  19.     fi
  20. done
  21. echo "==============================="
  22. if [[ $ok -eq 0 ]]
  23. then
  24.     echo "All services are running!"
  25. else
  26.     echo "There is some problems!"
  27. fi
  28. echo "==============================="
  29.  
  30.  
  31. if [[ $1 == run ]]
  32. then
  33.     echo "Starting services"
  34.     ssh merlin ssh pcnlp1 'screen -dmS "sleeper" /mnt/minerva1/nlp/projects/spinn3r/stanford/run.sh en 0'
  35. fi
  36.  
  37. function starting {
  38.     echo "Starting $1"
  39. }
  40.  
  41. # master
  42. masters=("master.py 1"
  43. "master.py 3"
  44. "master.py 4")
  45. for master in ${masters[*]}
  46. do
  47.     if [[ $out != *$master* ]]
  48.     then
  49.         echo "Starting master.sh ${master:9:2}"
  50.         ssh merlin ssh athena "screen -dmS \"master\" /mnt/minerva1/nlp/projects/spinn3r/master/master.sh ${master:9:2}"
  51.     fi
  52. done
  53.  
  54. # termvector
  55. if [[ $out != *termvector.sh* ]]
  56. then
  57.     echo "Starting termvector.sh"
  58.     ssh merlin ssh athena 'screen -dmS "termvector" /mnt/minerva1/nlp/projects/spinn3r/db/termvector.sh'
  59. fi
  60.  
  61. # affected
  62. if [[ $out != *affected.sh* ]]
  63. then
  64.     echo Starting affected.sh
  65.     ssh merlin ssh athena 'screen -dmS "affected" /mnt/minerva1/nlp/projects/spinn3r/db/affected.sh'
  66. fi
  67.  
  68. # stahovak
  69. if [[ $out != *stahovak.sh* ]]
  70. then
  71.     echo Starting stahovak.sh
  72.     ssh merlin ssh athena 'screen -dmS "stahovak" /mnt/minerva1/nlp/projects/spinn3r/stahovak/stahovak.sh'
  73. fi
  74.  
  75. # alchemized
  76. if [[ $out != *alchemized.sh* ]]
  77. then
  78.     echo Starting alchemized.sh
  79.     ssh merlin ssh athena 'screen -dmS "alchemized" /mnt/minerva1/nlp/projects/spinn3r/stahovak/alchemized.sh'
  80. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement