blob: f8e9bbf334f24dbd11fdda4fcf0fb60964dfc64a [file] [log] [blame]
Austin Schuha617d032017-09-14 00:06:59 -07001#!/bin/bash
2cd $(dirname $0)
3pwd
4
5set -e
6
7if [ $# != 1 ];
8then
9 echo "Usage: setup_robot.sh 971"
10 exit 1
11fi
12
13readonly ROBOT_HOSTNAME="$1"
14
15bazel build -c opt @arm_frc_linux_gnueabi_repo//...
16
17ssh-copy-id "admin@${ROBOT_HOSTNAME}"
18
19if $(ssh "admin@${ROBOT_HOSTNAME}" "cat /etc/profile" | grep -Fq "alias l");
20then
21 echo "Already has l alias"
22else
23 echo "Adding l alias"
24 ssh "admin@${ROBOT_HOSTNAME}" 'echo "alias l=\"ls -la\"" >> /etc/profile'
25fi
26
Michael Schuhade78102018-01-20 13:56:15 -080027# 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.
30ssh "admin@${ROBOT_HOSTNAME}" 'chmod go+rx robot_code/starter.sh'
31
Austin Schuha617d032017-09-14 00:06:59 -070032ssh "admin@${ROBOT_HOSTNAME}" 'PATH="${PATH}":/usr/local/natinst/bin/ /usr/local/frc/bin/frcKillRobot.sh -r -t'
33
34echo "Deploying robotCommand startup script"
35scp aos/config/robotCommand "admin@${ROBOT_HOSTNAME}:/home/lvuser/"
36
37scp 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/"