ProxyDock icon indicating copy to clipboard operation
ProxyDock copied to clipboard

additional Script For showing Public ip and location for each container

Open mlynxGit opened this issue 6 years ago • 0 comments

Add This To a bash file and install testProxyDock.zip

curl and jq dependencies and run it to get proxy public ip address and location `#!/bin/bash

ISHEADER=true for i in $(docker container ls --format "table {{.Ports}}"); do if $ISHEADER ; then ISHEADER=false printf "%-30s | %-30s | %-30s \n" 'PROXY' 'IP' 'LOCATION' else PROXY="$(cut -d'-' -f1 <<< " "$i" ")" PROXY_NO_WHITESPACE="$(echo -e "${PROXY}" | tr -d '[:space:]')" HTTP_RESPONSE="$(curl -s -x $PROXY_NO_WHITESPACE -L https://api.myip.com)" IP="$(jq .ip <<< " "$HTTP_RESPONSE" ")" LOCATION="$(jq .country <<< " "$HTTP_RESPONSE" ")"
printf "%-30s | %-30s | %-30s \n" "$PROXY_NO_WHITESPACE" "$IP" "$LOCATION" fi

done`

mlynxGit avatar Mar 04 '20 04:03 mlynxGit