From 921ff76178a468552189137076193ed70dd7ffbe Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Mon, 15 Aug 2022 10:10:29 -0500 Subject: [add] threadcat-del command --- threadcat | 4 +++- threadcat-del.sh | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 threadcat-del.sh diff --git a/threadcat b/threadcat index 0de4bb2..3703140 100755 --- a/threadcat +++ b/threadcat @@ -14,6 +14,7 @@ if [ -z "${THREADCAT_SUBCOMMAND}" ]; then echo " list lists threads, most recent first" echo " read [THREAD] reads a thread, printing to stdout" echo " write [THREAD] posts to THREAD from stdin" + echo " del [THREAD] delete a thread" exit 0 fi @@ -21,6 +22,7 @@ case "$THREADCAT_SUBCOMMAND" in "list" ) threadcat-list.sh ;; "read" ) threadcat-read.sh $2 ;; "write" ) threadcat-write.sh $2 ;; + "del" ) threadcat-delete.sh $2 ;; * ) echo Unknown subcommand $THREADCAT_SUBCOMMAND - echo commands are list, read, write;; + echo commands are list, read, write, del;; esac diff --git a/threadcat-del.sh b/threadcat-del.sh new file mode 100755 index 0000000..cd71da6 --- /dev/null +++ b/threadcat-del.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +THREAD_NAME=$1 + +if [ ! -z "${THREAD_NAME}" ]; then + ssh $THREADCAT_USER "rm /opt/threadcat/$THREAD_NAME" +else + echo You did not provide a thread name. + echo USAGE: "threadcat del THREAD_NAME" +fi + -- cgit v1.2.3