Created
December 10, 2013 18:46
-
-
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
This file contains 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
#!/bin/bash | |
echo "{" | |
echo "\"_comment\": \"Valid terminals include: 'Terminal.app' or 'iTerm'\"," | |
echo "\"terminal\": \"iTerm\"," | |
echo "\"hosts\": [" | |
echo "{" | |
echo "\"name\": \"Vagrant\"," | |
echo "\"cmd\": \"ssh [email protected] -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