1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/bin/bash configuration_file="${1:-#ETC#/colocation-client.conf}" jq '{ colocation_server, machine: .machines[] } | { url: ( .colocation_server + "update.php" + ( "?machine=" + .machine.machine + "&key=" + .machine.key ) ), values: .machine.values, }' \ <"${configuration_file}"