Create ~/.ssh on the rrio if it doesn't exist

This commit is contained in:
Austen Adler 2015-01-09 21:08:50 -05:00
parent 84f30510ab
commit ed8c4ac5b2

View File

@ -12,6 +12,6 @@ echo "echo 'Starting build';(test -d /vagrant/src/Debug&&test -f /vagrant/src/De
# Uploads the code to the rRIO based on /vagrant/config/host file
echo "cat /vagrant/build/FRCUserProgram | ssh \`cat /vagrant/config/host|head -n 1\` 'cat > /home/lvuser/FRCUserProgram2&&rm /home/lvuser/FRCUserProgram;mv /home/lvuser/FRCUserProgram2 /home/lvuser/FRCUserProgram&&. /etc/profile.d/natinst-path.sh;chmod a+x /home/lvuser/FRCUserProgram;/usr/local/frc/bin/frcKillRobot.sh -t -r'||echo 'You probably haven\'t succesfully built yet. Run build to compile the program''" > /usr/local/bin/deploy
# Creates ssh key if it doesn't exist and cats the public key to the rRIO
echo "test -d ~/.ssh||mkdir ~/.ssh;test -f ~/.ssh/id_rsa||ssh-keygen -t rsa -f ~/.ssh/id_rsa -b 4096 -q -N '';cat ~/.ssh/id_rsa.pub|ssh \`cat /vagrant/config/host|head -n 1\` 'cat >> ~/.ssh/authorized_keys'" > /usr/local/bin/putkey
echo "test -d ~/.ssh||mkdir ~/.ssh;test -f ~/.ssh/id_rsa||ssh-keygen -t rsa -f ~/.ssh/id_rsa -b 4096 -q -N '';cat ~/.ssh/id_rsa.pub|ssh \`cat /vagrant/config/host|head -n 1\` 'cat >> /tmp/key;mkdir -p ~/.ssh;cat /tmp/key >> ~/.ssh/authorized_keys;rm /tmp/key'" > /usr/local/bin/putkey
chmod +x /usr/local/bin/build /usr/local/bin/deploy /usr/local/bin/putkey
echo "Done provisioning. Run vagrant ssh to connect to the virtual machine."