coreos/init — pull request #17 by hayesgm (2013-09-05 07:43:05+00:00)
Title: For c10n init script, if URL contents contain an initialization script, run it

The c10n init script helps bootstrap etcd, but also helps bootstrap the system with user data.

Currently, the script will grab a url provided in [user-data](http://docs.aws.amazon.com/AWSEC2/2007-03-01/DeveloperGuide/AESDG-chapter-instancedata.html). If the contents (via `curl`) of that URL contain an SSH key, that key is appended to `authorized_keys`.

It is useful in a number of cases to be able to supply an init script at this HTTP url. This commit will check if the contents of the curl result begin with a shebang, and if so, runs those contents as a script. This script can install ssh keys or perform other initialization, such as adding units to systemd.

Additionally, the assumption that the URL is a GitHub gist and appending **/raw** to the URL is arbitrary. I've changed the process to grab the URL as given. For backwards compatibility, I've made sure GitHub gists without **/raw** still work as expected.