#!/bin/sh

PATH=/bin:/usr/bin:/sbin:/usr/sbin

# Show RX bytes
/sbin/ipchains -L -v -x -n | grep "^ .* $1.in" | (read a b c; echo $b)

# Show TX bytes
/sbin/ipchains -L -v -x -n | grep "^ .* $1.out" | (read a b c; echo $b)

# Show uptime
if uptime | grep -q day
then
  uptime | sed 's/.* up \([^,]*,[^,]*\),.*/\1/'
else
  uptime | sed 's/.* up \([^,]*\),.*/\1/'
fi

# Show hostname
hostname
