Shutdown server when network inactive

I was referring script to shutdown server from local interface [ubuntu] Automaticly shutdown after periode of inactivity [Archive] - Ubuntu Forums. This is scheduled in CRON. It will run every 20 minutes
and check for inactivity. It compares the RX and TX packets from 20 minutes ago to detect if they significantly increased. If they haven't, it will force the system to sleep.But in my case its not working properly.
I wanted to know what below expression does.
if [ $rx -le $t_rx ] || [ $tx -le $t_tx ]; then ## If network packets have not changed that much
echo "Powering off ..." >> $log