Skip to content

Instantly share code, notes, and snippets.

@jhh
Last active December 11, 2016 23:17
Show Gist options
  • Save jhh/2afbe586c24d760c343756e3d5a798b6 to your computer and use it in GitHub Desktop.
Save jhh/2afbe586c24d760c343756e3d5a798b6 to your computer and use it in GitHub Desktop.
Deploy C++ robot app to roboRIO
#!/bin/bash
# Put this in ~/.ssh/config to avoid the password check and ssh noise
# you need to have ssh public key for IdentityFile in roboRIO /home/admin/.ssh/authorized_keys
#
# Host roborio
# IdentityFile ~/.ssh/roborio
# HostName roborio-TTTT-frc.local
# User admin
# StrictHostKeyChecking no
# UserKnownHostsFile /dev/null
# LogLevel QUIET
# set these for your build
PROGRAM=my-robot
SRC=build/src/$PROGRAM
DST=/home/lvuser/FRCUserProgram
echo Deploying $PROGRAM to roboRIO...
# this avoids "text file busy" error when ssh writes over executing file
scp $SRC roborio:$DST.tmp
ssh roborio <<END_SSH
mv $DST.tmp $DST
. /etc/profile.d/natinst-path.sh
/usr/local/frc/bin/frcKillRobot.sh -r -t
END_SSH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment