Add imu to /etc/hosts as pi5

Still would need to manually change /etc/hosts for imu pi

Also updating camera calibration files

Change-Id: I9ffe8f604bed692408867d17f41ac33de5b7abc2
Signed-off-by: Jim Ostrowski <yimmy13@gmail.com>
diff --git a/frc971/raspi/rootfs/change_hostname.sh b/frc971/raspi/rootfs/change_hostname.sh
index c9b0b35..f555048 100755
--- a/frc971/raspi/rootfs/change_hostname.sh
+++ b/frc971/raspi/rootfs/change_hostname.sh
@@ -1,9 +1,10 @@
 #!/bin/bash
 
-set -euo pipefail
+set -xeuo pipefail
 
 HOSTNAME="$1"
 
+# TODO<Jim>: Should probably add handling for imu hostname, too
 if [[ ! "${HOSTNAME}" =~ ^pi-[0-9]*-[0-9]$ ]]; then
   echo "Invalid hostname ${HOSTNAME}, needs to be pi-[team#]-[pi#]"
   exit 1
@@ -22,6 +23,7 @@
 
 echo "${HOSTNAME}" > /etc/hostname
 
+# Put corret team number in pi's IP addresses, or add them if needed
 if grep '^10\.[0-9]*\.[0-9]*\.[0-9]*\s*pi-[0-9]*-[0-9] pi[0-9]$' /etc/hosts >/dev/null ;
 then
   sed -i "s/^10\.[0-9]*\.[0-9]*\(\.[0-9]*\s*pi-\)[0-9]*\(-[0-9] pi[0-9]\)$/${IP_BASE}\1${TEAM_NUMBER}\2/" /etc/hosts
@@ -31,6 +33,7 @@
   done
 fi
 
+# Put corret team number in roborio's address, or add it if missing
 if grep '^10\.[0-9]*\.[0-9]*\.2\s*roborio$' /etc/hosts >/dev/null;
 then
   sed -i "s/^10\.[0-9]*\.[0-9]*\(\.2\s*roborio\)$/${IP_BASE}\1/" /etc/hosts
@@ -38,9 +41,23 @@
   echo -e "${IP_BASE}.2\troborio" >> /etc/hosts
 fi
 
+# Put corret team number in logger's address, or add it if missing
 if grep '^10\.[0-9]*\.[0-9]*\.13\s*logger$' /etc/hosts >/dev/null;
 then
   sed -i "s/^10\.[0-9]*\.[0-9]*\(\.13\s*logger\)$/${IP_BASE}\1/" /etc/hosts
 else
   echo -e "${IP_BASE}.13\tlogger" >> /etc/hosts
 fi
+
+# Put corret team number in imu's address, or add it if missing
+if grep '^10\.[0-9]*\.[0-9]*\.105\s.*\s*imu$' /etc/hosts >/dev/null;
+then
+  sed -i "s/^10\.[0-9]*\.[0-9]*\(\.105\s.*imu\)$/${IP_BASE}\1/" /etc/hosts
+else
+  if grep '^10\.[0-9]*\.[0-9]*\.105\s*pi-[0-9]*-[0-9]*\s*pi5$' /etc/hosts
+  then
+    sed -i "s/^10\.[0-9]*\.[0-9]*\(\.[0-9]*\s*pi-\)[0-9]*\(-[0-9] pi5\)$/${IP_BASE}\1${TEAM_NUMBER}\2 imu/" /etc/hosts
+  else
+    echo -e "${IP_BASE}.105\tpi-${TEAM_NUMBER}-5 pi5 imu" >> /etc/hosts
+  fi
+fi