From d5a969a24ddc836f15c06e5822981298c3433131 Mon Sep 17 00:00:00 2001 From: Mark McDonnell Date: Tue, 22 Mar 2016 11:19:18 +0000 Subject: [PATCH] Create scp-remote-to-local.sh --- scp-remote-to-local.sh | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 scp-remote-to-local.sh diff --git a/scp-remote-to-local.sh b/scp-remote-to-local.sh new file mode 100644 index 0000000..11d18d3 --- /dev/null +++ b/scp-remote-to-local.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# +# Dependencies: +# brew install jq +# +# Example: +# /bin/bash ./results.sh +# +# Description: +# Grabs list of running instances for specified BBC Cosmos component (TEST environment) +# SCP's known log locations from remote to new local directory + +# Enable a form of 'strict mode' for Bash +set -euo pipefail +IFS=$'\n\t' + +# Define our expected variables up front +cert=${1:-} +component=${2:-} +user=${3:-} +api="https://api.live.bbc.co.uk/cosmos/env/test/component/$component/instances" + +if [ "$#" -ne 3 ]; then + cat <