: bharatvaj/scripts

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
#!/usr/bin/env jq -rf

"# vi: set ft=sshconfig\n",
(.instances[] | 
"# Created: \(.date_created)\n" +
(if .tags and (.tags | length > 0) then
    "# Tags: \(.tags | join(", "))\n"
else "" end) +
"Host \(.label)
    Hostname \(.main_ip)
    User root
")
# (if .region then
#     "    # Region: \(.region)\n"
# else "" end) +
# (if .status then
#     "    # Status: \(.status)\n"
# else "" end)
# (if .ipv4[1] then
#     "    # Secondary IP: \(.ipv4[1])\n"
# else "" end)