Skip to content

Instantly share code, notes, and snippets.

@jkawamoto
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkawamoto/8c8ea77840a564bbd2f5 to your computer and use it in GitHub Desktop.
Save jkawamoto/8c8ea77840a564bbd2f5 to your computer and use it in GitHub Desktop.
Startup script loading a script on GCS
#!/bin/bash
URL=$(curl http://metadata/computeMetadata/v1/instance/attributes/startup -H "Metadata-Flavor: Google")
docker pull google/cloud-sdk
cd /tmp
docker run -t --rm google/cloud-sdk /google-cloud-sdk/bin/gsutil cat $URL | tr -d "\r" > startup.sh
chmod a+x startup.sh
./startup.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment