#!/bin/bash
SOURCE="$0"
source /usr/lib/elive-tools/functions
EL_REPORTS="1"
#el_make_environment


main(){
    # pre {{{
    local input output Bi Bo
    if ! el_dependencies_check iptables ; then
        if ! el_dependencies_install iptables ; then
            exit 1
        fi
    fi

    # }}}
    input="$( sudo iptables -L -n -x -v | grep -F INPUT | awk '{print $7}')"
    output="$( sudo iptables -L -n -x -v | grep -F OUTPUT | awk '{print $7}')"

    Bi="$( expr $input / 1048576 )"
    Bo="$( expr $output / 1048576 )"

    if [[ -n "$Bi" ]] && [[ -n "$Bi" ]] ; then
        echo -e "Downloaded $Bi MB ($input bytes)"
        echo -e "Uploaded   $Bo MB ($output bytes)"

    fi
}

#
#  MAIN
#
main "$@"

# vim: set foldmethod=marker :
