Austin Schuh | a617d03 | 2017-09-14 00:06:59 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | cd $(dirname $0) |
| 3 | pwd |
| 4 | |
| 5 | set -e |
| 6 | |
| 7 | if [ $# != 1 ]; |
| 8 | then |
| 9 | echo "Usage: setup_robot.sh 971" |
| 10 | exit 1 |
| 11 | fi |
| 12 | |
| 13 | readonly ROBOT_HOSTNAME="$1" |
| 14 | |
| 15 | bazel build -c opt @arm_frc_linux_gnueabi_repo//... |
| 16 | |
| 17 | ssh-copy-id "admin@${ROBOT_HOSTNAME}" |
| 18 | |
| 19 | if $(ssh "admin@${ROBOT_HOSTNAME}" "cat /etc/profile" | grep -Fq "alias l"); |
| 20 | then |
| 21 | echo "Already has l alias" |
| 22 | else |
| 23 | echo "Adding l alias" |
| 24 | ssh "admin@${ROBOT_HOSTNAME}" 'echo "alias l=\"ls -la\"" >> /etc/profile' |
| 25 | fi |
| 26 | |
Michael Schuh | ade7810 | 2018-01-20 13:56:15 -0800 | [diff] [blame] | 27 | # Make sure starter.sh has the correct permissions to run the robot code. |
| 28 | # If missing o+rx, the robot code will not start. No error messages on |
| 29 | # some driver stations. |
| 30 | ssh "admin@${ROBOT_HOSTNAME}" 'chmod go+rx robot_code/starter.sh' |
| 31 | |
Austin Schuh | a617d03 | 2017-09-14 00:06:59 -0700 | [diff] [blame] | 32 | ssh "admin@${ROBOT_HOSTNAME}" 'PATH="${PATH}":/usr/local/natinst/bin/ /usr/local/frc/bin/frcKillRobot.sh -r -t' |
| 33 | |
| 34 | echo "Deploying robotCommand startup script" |
| 35 | scp aos/config/robotCommand "admin@${ROBOT_HOSTNAME}:/home/lvuser/" |
| 36 | |
| 37 | scp bazel-971-Robot-Code/external/arm_frc_linux_gnueabi_repo/usr/arm-frc-linux-gnueabi/lib/libstdc++.so.6.0.20 "admin@${ROBOT_HOSTNAME}:/usr/lib/" |