http_post() { | |
if [ $# != 2 ]; then | |
echo "Usage: http_post <url> <data>" 1>&2 | |
return 255 | |
fi | |
#curl "$1" --request POST --data-binary "$2" | |
wget --no-verbose "$1" --post-data "$2" | |
} | |
get_ip_address() { | |
if [ $# != 1 ]; then | |
echo "Usage: get_ip_address <interface>" 1>&2 | |
return 255 | |
fi | |
ifconfig "$1" | grep -Eo -m 1 'inet[ a-z:]+172\.20\.0\.[0-9]{3}' | sed -r 's/^inet[ a-z:]+//' | |
return 0 | |
} |