Skip to content

Instantly share code, notes, and snippets.

@mcouthon mcouthon/script.sh
Created Mar 4, 2018

Embed
What would you like to do?
Example of script that adds a file
#!/usr/bin/env bash
echo "Deploying SSH key"
cat > ssh_key << _EOF_
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEA6jl5GPIGLakcD7Xr+HWDS3NGwT0xmRcqFUnsYCpOsBeRBYcD
58Pq6JBEs2A3+kw+LIEawuFLM2//MZYxkRH0qmM/XosTaJbo1spLTSt67ILdtXmX
xGZqxArZWALekGDpeafcZraBCBY7is3Kn9Sm8ZQaM7uYzP5zYDMP8V+FajmFzMRb
0RV/DprvthC6HE5Z5k+lmZZ/F+vbWOL8PPZBO83A/Lg5h8BFwp9UKbMxHtV7eUKI
...
5mu2XWoehOoKSubFEUo/M98XAsMck0Ud/o1u3aFIOcm+buX6tuoSoN6PhSIaE2yX
hSFIWcECgYEAhDYRrP8LZ/xRfzXBBtGQ2+Rvv0wbgVlYF/vjvpWLvlZ42nX3RQvk
ELzymD6k5zEQjTMhA96TzNnx3HnW6YE1uK3Tg75FbAOPK5HB/WqkCl24AIT4CiM+
tGhXWg1fwlBFH1jdUDe8r1+CwPtAIQKd5ul8i3o6n4eMl4uCubRGIgA=
-----END RSA PRIVATE KEY-----
_EOF_
echo "Copying ssh key to final location"
sudo cp ssh_key /etc/cloudify/ssh_key
echo "Changing permissions"
sudo chown cfyuser: /etc/cloudify/ssh_key
sudo chmod 400 /etc/cloudify/ssh_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.