Created
May 31, 2013 17:03
-
-
Save bakins/5686377 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/bash | |
| if [[ ! -f /root/.ssh/authorized_keys ]]; then | |
| authorized_keys=$(/usr/sbin/mdata-get root_authorized_keys) | |
| if [[ -n ${authorized_keys} ]]; then | |
| mkdir -p /root/.ssh | |
| echo -e "${authorized_keys}" > /root/.ssh/authorized_keys | |
| chmod 700 /root/.ssh | |
| chmod 600 /root/.ssh/authorized_keys | |
| fi | |
| fi | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment