-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart
executable file
·26 lines (21 loc) · 938 Bytes
/
start
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
#!/usr/bin/env bash
# Start / Restart Script
# Networking
IP5="192.168.88.5" # Raspberry pi with maestro ip address
IP4="192.168.88.4" # Raspberry pi with tooling board ip address
# Open Google Chrome on localhost if it is not already running
if ps ax | grep -v grep | grep "chrome" > /dev/null
then
echo "Google Chrome is already running."
else
setsid google-chrome localhost &
fi
# Start / restart raspberry pi communications
sshpass -p raspberry ssh pi@${IP5} /bin/sh -c '"pkill -f raspiComms.py"'
xterm -geometry 93x31+0+0 -e sshpass -p raspberry ssh pi@${IP5} /bin/sh -c '"cd /home/pi/raspi/ && python3 raspiComms.py"' &
sshpass -p raspberry ssh pi@${IP4} /bin/sh -c '"pkill -f raspiComms.py"'
xterm -geometry 93x31+0+0 -e sshpass -p raspberry ssh pi@${IP4} /bin/sh -c '"cd /home/pi/raspi/ && python3 raspiComms.py"' &
# Start / restart topsides server
sudo pkill -f main.py
cd ~/eer/2019/topsides/
sudo python3 main.py