forked from ArduPilot/companion
-
Notifications
You must be signed in to change notification settings - Fork 54
/
.companion.rc
executable file
·40 lines (38 loc) · 2.17 KB
/
.companion.rc
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
export COMPANION_DIR=/home/pi/companion
# copy default parameters if neccessary
for default_param_file in $COMPANION_DIR/params/*.param.default; do
param_file=/home/pi/$(basename -- $(echo $default_param_file | sed "s/.default//"))
if [ ! -e "$param_file" ]; then
cp $default_param_file $param_file
fi
done
if [ ! -f /home/pi/.updating ]; then
sudo python $COMPANION_DIR/tools/ping_enumerator.py || true
if [ -d /dev/serial/ping ]; then
sudo -H -u pi screen -dm -S pingproxy pingproxy.py --device $(ls -d /dev/serial/ping/Ping1* | head -1)
sudo -H -u pi screen -dm -S pingmav python $COMPANION_DIR/tools/ping1d_mavlink_driver.py
fi
sudo -H -u pi screen -dm -S mavproxy $COMPANION_DIR/tools/telem.py
sudo -H -u pi screen -dm -S video $COMPANION_DIR/tools/streamer.py
sudo -H -u pi screen -dm -S webui $COMPANION_DIR/scripts/start_webui.sh
sudo -H -u pi screen -dm -S webterminal $COMPANION_DIR/scripts/start_webterminal.sh
sudo -H -u pi screen -dm -S commrouter $COMPANION_DIR/tools/comm_router.py
sudo -H -u pi screen -dm -S audio $COMPANION_DIR/tools/audio.py
sudo -H -u pi screen -dm -S file-manager node --harmony $COMPANION_DIR/br-webui/node_modules/node-file-manager/lib/index.js -p 7777 -d /
sudo -H -u pi screen -dm -S nmearx $COMPANION_DIR/tools/nmea-receiver.py
sudo -H -u pi screen -dm -S wldriver $COMPANION_DIR/tools/underwater-gps.py --ip=192.168.2.94 --port=80
sudo -H -u pi screen -dm -S bridgemanager $COMPANION_DIR/tools/ping360_bridge_manager.py
sudo -H -u pi screen -dm -S mavlink2rest $COMPANION_DIR/tools/mavlink2rest --connect udpout:127.0.0.1:9000 --server 0.0.0.0:4777 --system-id 1 --component-id 99
sudo -H -u root screen -dm -S network-service $COMPANION_DIR/services/network/main.py
sudo -H -u pi screen -dm -S dvl-service $COMPANION_DIR/services/waterlinked/dvl-a50/main.py
$COMPANION_DIR/scripts/start-ardusub-linux.sh || true
else
sudo -H -u pi echo 'UPDATE FAILED!' >> /home/pi/.update_log
rm -f /home/pi/.updating
if [ -d /home/pi/.companion ]; then
rm -rf $COMPANION_DIR
sudo -H -u pi cp -r /home/pi/.companion $COMPANION_DIR
fi
sudo -H -u pi echo 'Trying to run again...' >> /home/pi/.update_log
$COMPANION_DIR/.companion.rc
fi