Skip to content

Instantly share code, notes, and snippets.

@alanivey
Created December 10, 2013 18:46
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 alanivey/7895869 to your computer and use it in GitHub Desktop.
Save alanivey/7895869 to your computer and use it in GitHub Desktop.
Shuttle (http://fitztrev.github.io/shuttle/) config with Vagrant, all Storm on Demand (stormondemand.com) servers, and all Liquid Web servers
#!/bin/bash
echo "{"
echo "\"_comment\": \"Valid terminals include: 'Terminal.app' or 'iTerm'\","
echo "\"terminal\": \"iTerm\","
echo "\"hosts\": ["
echo "{"
echo "\"name\": \"Vagrant\","
echo "\"cmd\": \"ssh vagrant@127.0.0.1 -p 2222 -i ~/.vagrant.d/insecure_private_key\""
echo "},"
STORM=$(curl -s --user 'storm_user:storm_password' -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST -d '{"params":{"category":"Dedicated"}}' https://api.stormondemand.com/v1/Server/list | jq -M '{"Storm": [.items[].domain as $domain | {cmd: "ssh \($domain)", name: $domain}]}' | sed 's/\("name": "[a-z0-9-]*\).domain.com/\1/g')
echo -n $STORM
echo ","
LW=$(curl -s --user 'liquidweb_user:liquidweb_password' -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST -d '{"params":{"category":"Dedicated"}}' https://api.stormondemand.com/v1/Server/list | jq -M '{"Liquid Web": [.items[] | select(.type == "DS.P1" or .type == "DS.W1") | .domain as $domain | {cmd: "ssh \($domain)", name: $domain}]}' | sed 's/\("name": "[a-z0-9-]*\).domain.com/\1/g')
echo -n $LW
# echo ","
echo
echo "]"
echo "}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment