Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- out=`ssh merlin "ssh athena \"ps U xrylko00\""`
- IFS=$'\n' ### changes break point for arrays!!! no break on spaces
- kws=(
- "calaised.py 0"
- "calaised.py 100"
- stanfordtoinstances.py)
- ok=0
- for kw in ${kws[*]}
- do
- if [[ $out != *$kw* ]]
- then
- echo "ERROR ($kw)"
- ok+=1
- else
- echo "OK ($kw)"
- fi
- done
- echo "==============================="
- if [[ $ok -eq 0 ]]
- then
- echo "All services are running!"
- else
- echo "There is some problems!"
- fi
- echo "==============================="
- if [[ $1 == run ]]
- then
- echo "Starting services"
- ssh merlin ssh pcnlp1 'screen -dmS "sleeper" /mnt/minerva1/nlp/projects/spinn3r/stanford/run.sh en 0'
- fi
- function starting {
- echo "Starting $1"
- }
- # master
- masters=("master.py 1"
- "master.py 3"
- "master.py 4")
- for master in ${masters[*]}
- do
- if [[ $out != *$master* ]]
- then
- echo "Starting master.sh ${master:9:2}"
- ssh merlin ssh athena "screen -dmS \"master\" /mnt/minerva1/nlp/projects/spinn3r/master/master.sh ${master:9:2}"
- fi
- done
- # termvector
- if [[ $out != *termvector.sh* ]]
- then
- echo "Starting termvector.sh"
- ssh merlin ssh athena 'screen -dmS "termvector" /mnt/minerva1/nlp/projects/spinn3r/db/termvector.sh'
- fi
- # affected
- if [[ $out != *affected.sh* ]]
- then
- echo Starting affected.sh
- ssh merlin ssh athena 'screen -dmS "affected" /mnt/minerva1/nlp/projects/spinn3r/db/affected.sh'
- fi
- # stahovak
- if [[ $out != *stahovak.sh* ]]
- then
- echo Starting stahovak.sh
- ssh merlin ssh athena 'screen -dmS "stahovak" /mnt/minerva1/nlp/projects/spinn3r/stahovak/stahovak.sh'
- fi
- # alchemized
- if [[ $out != *alchemized.sh* ]]
- then
- echo Starting alchemized.sh
- ssh merlin ssh athena 'screen -dmS "alchemized" /mnt/minerva1/nlp/projects/spinn3r/stahovak/alchemized.sh'
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement