mkdir /dev/shm/hmon
#Kill old tunnel, make new one. Better: Check if tunnel still exists, if not restart.
-echo " <Hmon> Renewing tunnels and environment..."
+echo " <Hmon> Renewing environment..."
-pgrep -f 'ssh -R 8888' >/dev/null
-if [ $? -eq 1 ]; then
-echo " <Hmon> No tunnel found, digging new one";
+#pgrep -f 'ssh -R 8888' >/dev/null
+#if [ $? -eq 1 ]; then
+#echo " <Hmon> No tunnel found, digging new one";
#ssh -f -R 8888:hades33.gsi.de:80 -R 3060:hades33.gsi.de:80 -R 8889:hades33.gsi.de:1234 -R 9999:lxhadeb06p:80 cerberus.x-matter.uni-frankfurt.de -N &a
#ssh -f -R 8888:hades33.gsi.de:80 -R 3060:hades33.gsi.de:80 cerberus.x-matter.uni-frankfurt.de -N &
-tmux new-session -s cerberus_tunnel -d 'while true; do ssh -R 8888:hades33.gsi.de:80 -R 3060:hades33.gsi.de:80 cerberus.x-matter.uni-frankfurt.de -N -v; sleep 10; done'
-fi
+#tmux new-session -s cerberus_tunnel -d 'while true; do ssh -R 8888:hades33.gsi.de:80 -R 3060:hades33.gsi.de:80 cerberus.x-matter.uni-frankfurt.de -N -v; sleep 10; done'
+#fi
#########
#ssh hadesp57 pkill -f speakdaemon.pl
# cd ../
export DAQOPSERVER=hadesp31
-mkdir `pwd`/archive
-mkdir `pwd`/qa
-mkdir `pwd`/logs
-mkdir `pwd`/vertex
-mkdir `pwd`/pion
+mkdir -p `pwd`/archive
+mkdir -p `pwd`/qa
+mkdir -p `pwd`/logs
+mkdir -p `pwd`/vertex
+mkdir -p `pwd`/pion
#DISPLAY=:0 ssh -f -X lxhadeb06p "ping -i 100 lxhadesdaqp" &>/dev/null &
#sshfs -o allow_other hadaq@lxhadeb06p:/home/hadaq/local/hydra2/online/feb21_master/online/pics/vertex `pwd`/vertex
#sshfs -o allow_other hadaq@lxhadeb06p:/home/hadaq/local/hydra2/online/feb21/online/pics `pwd`/qa
+pkill -f "sshfs -o allow_other hadaq@hadesp66:/home/hades-qa/online/5.34.38/pics"
+sshfs -o allow_other hadaq@hadesp66:/home/hades-qa/online/5.34.38/pics `pwd`/qa
+
# sshfs -o allow_other hadaq@lxhadeb06p:/data01/tmp/ `pwd`/pion
+pkill -f "sshfs -o allow_other hadaq@hadesp63:/home/hadaq/local/tdcmon/dabc/cal"
sshfs -o allow_other hadaq@hadesp63:/home/hadaq/local/tdcmon/dabc/cal `pwd`/calibration
rm ~/trbsoft/hadesdaq/hmon/files/note.htt
-ssh hadesp57 'cd /home/hadaq/trbsoft/daq/hmon/; PERL5LIB=. ./speakdaemon.pl 1>/dev/null 2>>/home/hadaq/trbsoft/hadesdaq/hmon/logs/perlerror_speakdaemon' &
+#ssh hadesp57 'cd /home/hadaq/trbsoft/daq/hmon/; PERL5LIB=. ./speakdaemon.pl 1>/dev/null 2>>/home/hadaq/trbsoft/hadesdaq/hmon/logs/perlerror_speakdaemon' &
ssh hadesp33 'cd /home/hadaq/trbsoft/daq/hmon/; PERL5LIB=. ./speakdaemon.pl 1>/dev/null 2>>/home/hadaq/trbsoft/hadesdaq/hmon/logs/perlerror_speakdaemon' &
sleep 1;
pkill -f "\./hmon_.+\.pl" 2>/dev/null 1>/dev/null
pkill -f "sh -c \./hmon_.*\.sh"
-pkill -f "lxhadeb06p ping -i 100 lxhadesdaqp"
-pkill -f "/usr/bin/perl -w \./speakdaemon.pl"
-pkill -f "/usr/bin/perl -w \./hmon_.*\.sh"
+pkill -f "/usr/bin/perl \./speakdaemon.pl"
+pkill -f "/usr/bin/perl \./hmon_.*\.sh"
pkill -f "hmon_tail -n"
-pkill -f "hmon_ssh"
+#pkill -f "hmon_ssh" # don't do that for a normal daq-restart
# echo " <Hmon> Cleaning up..."
#!/bin/bash
+
killall hmon_permanent_tail
cd permanent
killall hmon*.pl 2>/dev/null 1>/dev/null
cd ../
+
+pkill -f "sshfs -o allow_other hadaq@hades66:/home/hades-qa/online/5.34.38/pics"
+pkill -f "sshfs -o allow_other hadaq@hadesp63:/home/hadaq/local/tdcmon/dabc/cal"
+
+
+pkill hmon_ssh
+
./stop.sh;
# echo " <Hmon> Killing all sub-processes..."