-
Notifications
You must be signed in to change notification settings - Fork 0
/
kill_all.sh
executable file
·52 lines (42 loc) · 1.67 KB
/
kill_all.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
SUCCESS=true
if ! ssh -o ConnectTimeout=10 -t [email protected] "tmux send-keys -t vizzy_startup.1 '/home/vizzy/vizzy-desktop-scripts/kill_controllers.sh' ENTER"; then
SUCCESS=false
fi
if ! $SUCCESS; then
echo "ssh failed to connect while killing controllers... exiting script";
echo "You have to kill the processes manually. Open the 'vizzy_startup tmux session at vizzy-desktop'";
read -p "Press [ENTER] key to close this window..." ENTER
exit -1;
fi
sleep 5
if ! ssh -o ConnectTimeout=10 -t [email protected] "tmux send-keys -t vizzy_startup.0 C-c"; then
SUCCESS=false
fi
if ! $SUCCESS; then
echo "ssh failed to connect while killing yarprobotinterface... exiting script";
echo "You have to kill the processes manually. Open the 'vizzy_startup tmux session at vizzy-desktop'";
read -p "Press [ENTER] key to close this window..." ENTER
exit -1;
fi
sleep 15
if ! ssh -o ConnectTimeout=10 -t [email protected] "tmux send-keys -t vizzy_startup.2 C-c"; then
SUCCESS=false
fi
if ! $SUCCESS; then
echo "ssh failed to connect while killing roscore... exiting script";
echo "You have to kill the processes manually. Open the 'vizzy_startup tmux session at vizzy-desktop'";
read -p "Press [ENTER] key to close this window..." ENTER
exit -1;
fi
sleep 5
if ! ssh -o ConnectTimeout=10 -t [email protected] "tmux kill-session -t vizzy_startup"; then
$SUCCESS=false
fi
if $SUCCESS; then
echo "All cleaned up! Bye!"
read -p "Press [ENTER] key to close this window..." ENTER
else
echo "Failed to kill temux vizzy_startup session..."
read -p "Press [ENTER] key to close this window..." ENTER
fi