aboutsummaryrefslogtreecommitdiffhomepage
path: root/threadcat-list.sh
blob: ad2b21cd5fe6514f877558e3e995cdb2b69981d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

BOARD=$1

LISTING_HEADING="~~~~~~~~~~~~~~~~~~~"


if [ -z "${BOARD}" ]; then
    echo "BOARDS"
    echo $LISTING_HEADING
    ssh $THREADCAT_USER "ls -lt /opt/threadcat | grep ^d" | awk '{ s = ""; for (i = 6; i <= 9; i++) s = s $i " "; print s }'
    echo ""
    echo "TOP LEVEL THREADS"
    echo $LISTING_HEADING
    ssh $THREADCAT_USER "ls -lt /opt/threadcat | grep -v ^d" | awk '{ s = ""; for (i = 6; i <= 9; i++) s = s $i " "; print s }'
else
    echo "Listing threads under $BOARD"
    echo $LISTING_HEADING
    ssh $THREADCAT_USER "ls -lt /opt/threadcat/$BOARD | grep -v ^d" | awk '{ s = ""; for (i = 6; i <= 9; i++) s = s $i " "; print s }'
fi