#!/bin/bash BOARD=$1 LISTING_HEADING="~~~~~~~~~~~~~~~~~~~" export CURTIME=`ssh $THREADCAT_USER date +%s` if [ -z "${BOARD}" ]; then echo "BOARDS" echo $LISTING_HEADING ssh $THREADCAT_USER "ls -lt --time-style=+%s /opt/threadcat | grep ^d" | \ awk '{ ago = (ENVIRON["CURTIME"] - $6) / (60*60); printf "%.0f hrs ago -- %s\n", ago, $7;}' echo "" echo "TOP LEVEL THREADS" echo $LISTING_HEADING ssh $THREADCAT_USER "ls -lt --time-style=+%s /opt/threadcat" | \ grep -v ^d | egrep -v '^total [0-9]+$' | \ awk '{ ago = (ENVIRON["CURTIME"] - $6) / (60*60); printf "%.0f hrs ago -- %s\n", ago, $7;}' else echo "BOARD: $BOARD" echo $LISTING_HEADING ssh $THREADCAT_USER "ls -lt --time-style=+%s /opt/threadcat/$BOARD" | \ grep -v ^d | egrep -v '^total [0-9]+$' | \ awk '{ ago = (ENVIRON["CURTIME"] - $6) / (60*60); printf "%.0f hrs ago -- %s\n", ago, $7;}' fi