Maintenance#

autopilot/maintenance in the repository

Scripts to maintain, updaate, etc. autopilot behavior rigs in wehr lab.

update_autopilot.sh#

The main script to update autopilot, run from the terminal computer, to keep the system up to date.

Each of the pilots has autopilot installed in ~/git/autopilot and the plugin directory is ~/autopilot/plugins (with the wehrlab plugin beneath that)

This script updates our local copy, and then calls update_pis.sh on each of the pis

echo "Updating Terminal Autopilot Version"
git -C /home/lab/git/autopilot pull
git -C /home/lab/autopilot/plugins/wehrlab pull
echo "Update Successful"

echo "Updating Pis"
parallel-ssh -h /home/lab/pi_ips.txt \
  -e /home/lab/autopilot_update_errors \
  -o /home/lab/autopilot_update_stdout \
  -I < /home/lab/update_pis.sh


echo "For changes on Pilots to take effect, restart them (with parallel-ssh -h ~/pi_ips.txt \"sudo restart\""

update_pis.sh#

Similar to update_autopilot.sh, but ensures that the time zone is correct for the pis.

Stdout and stderr output to ~/autopilot_update_stdout and ~/autopilot_update_errors on the terminal, respectively.

echo "---------------------------"
echo $(date)
echo "---------------------------"


git -C ~/git/autopilot pull
git -C ~/autopilot/plugins/wehrlab pull

echo "updated git repos"
echo "current autopilot version"
echo $(git -C ~/git/autopilot describe)
echo "current autopilot branch"
echo $(git -C ~/git/autopilot rev-parse --abbrev-ref HEAD)

# update timezone
sudo raspi-config nonint do_change_timezone US/Pacific

echo "updated timezone"

pi_ips.txt#

Used by update_pis.sh to send commands to multiple pilots at once with parallel-ssh (Also see configuring SSH access with RSA keys).

pi@192.168.0.101
pi@192.168.0.102
pi@192.168.0.103
pi@192.168.0.104
pi@192.168.0.105
pi@192.168.0.106
pi@192.168.0.107
pi@192.168.0.108
pi@192.168.0.109
pi@192.168.0.110