#!/bin/bash

if [ $1 = table ]
then
cmnd='iwpriv msh0 fwt_list'
t=19
fi

if [ $1 = neigh ]
then
cmnd='iwpriv msh0 fwt_list_neigh'
t=29
fi

if [ $2 = reset ]
then
iwpriv msh0 fwt_reset
fi

i=0
while [ 1 -eq 1 ]
do

test=$($cmnd $i | grep null)
while [ ${#test} -ne 0 ]
do 
test=$($cmnd $i | grep null)
if [ "$2" != "reset" ]
then exit
fi
done

echo -n $i' '
out=$($cmnd $i)
echo ${out:$t}
let i+=1

done
