Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
List information on Digital Ocean images
source .do
output=$(curl -s -X GET "" -H "Authorization: Bearer $TOKEN")
if [ "$1" == "-a" ]; then
echo $output | jq -s '.[][][] | { name: .name?, id: .id?, ip_address: .networks.v4[].ip_address} | select(.name | contains("redbeard"))' | grep -v -f reserved
echo $output | jq -s '.[][][] | { name: .name?, id: .id?} | select(.name | contains("redbeard")) | .id' | grep -v -f reserved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment