PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
#set -x
pkg=0; chan=0;
ncsi_cmd="/usr/local/bin/ncsi_cmd"
ncsi_status_file_0="/var/run/ncsi/ports/0/operstate"
ncsi_status_file_1="/var/run/ncsi/ports/1/operstate"

echo "eth0:"
if [ -s $ncsi_status_file_0 ]; 
then
    eth0_state=$(cat $ncsi_status_file_0)
    echo "$eth0_state"
else
    echo "Down"
fi

$ncsi_cmd eth0 $pkg $chan 0A

echo ""

echo "eth1:"
if [ -s $ncsi_status_file_1 ]; 
then
    eth1_state=$(cat $ncsi_status_file_1)
    echo "$eth1_state"
else
    echo "Down"
fi

$ncsi_cmd eth1 $pkg $chan 0A
