#!/bin/bash

if [[ $1 == 'port' ]]; then
    find /opt/apps/localcr/ -type f -name "*:*:*" | \
        awk -F '/' '{print $NF}' | \
        awk -F':' 'BEGIN{print "Local", "Container", "Application"} {print $1, $2, $3}' | \
        column -t |  \
        sort -nk 1
elif [[ $1 == 'ip' ]]; then
    find /opt/apps/localcr/ -type f -name "10.10.0.*" | awk -F '/' '{print $(NF-1), $NF}' | column -t | sort -k2
else
    :
fi
