diff options
author | Colin Okay <colin@cicadas.surf> | 2022-08-15 11:40:24 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-08-15 11:40:24 -0500 |
commit | 331eef1cdcc2fb183ca6ac3945b332dfd8581bff (patch) | |
tree | 6d4db3e6e6a464298c71d0831039ecd7fccdf974 /threadcat-list.sh | |
parent | 921ff76178a468552189137076193ed70dd7ffbe (diff) |
[add] [feature] sub-boards
Diffstat (limited to 'threadcat-list.sh')
-rwxr-xr-x | threadcat-list.sh | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/threadcat-list.sh b/threadcat-list.sh index 89f490e..3f19691 100755 --- a/threadcat-list.sh +++ b/threadcat-list.sh @@ -1,4 +1,20 @@ #!/bin/bash -ssh $THREADCAT_USER "ls -lt /opt/threadcat/" | awk '{ s = ""; for (i = 6; i <= 9; i++) s = s $i " "; print s }' +BOARD=$1 +LISTING_HEADING="~~~~~~~~~~~~~~~~~~~" + + +if [ -z "${BOARD}" ]; then + echo "BOARDS" + echo $LISTING_HEADING + ssh $THREADCAT_USER "ls -l /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 -l /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 |