#!/usr/bin/env bash

function get_ip_address()
{
    local ip=`ip -o -4 addr show up |egrep -v ': docker|: lo' |tail -1 | awk '{print $4}' |cut -f1 -d\/`

    echo $ip
}

sourcef=${BASH_SOURCE[0]}
if [ $sourcef == $0 ]; then
    get_ip_address $@
fi
