aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-08-14 20:12:31 -0500
committerColin Okay <colin@cicadas.surf>2022-08-14 20:12:31 -0500
commitb801c7082d48f35321a39d28d9a9e74767a3461d (patch)
treedcffaafdd4305a8d399d22a1c0285dd308b07f6b
initial commit; [add] threadcat-write script
-rwxr-xr-xthreadcat-write.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/threadcat-write.sh b/threadcat-write.sh
new file mode 100755
index 0000000..e328fc2
--- /dev/null
+++ b/threadcat-write.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+CICADAS_USER=$1
+THREAD_NAME=$2
+
+
+if [ ! -z "${CICADAS_USER}" ]; then
+ if [ ! -z "${THREAD_NAME}" ]; then
+ cat - | ssh $CICADAS_USER@cicadas.surf "umask 002 && echo `whoami` -- `date` >> /opt/threadcat/$THREAD_NAME && cat - >> /opt/threadcat/$THREAD_NAME"
+ echo Posted to $THREAD_NAME
+ else
+ echo You did not provide a thread name.
+ echo USAGE: "cat <YOURMESSAGE> | threadcat-write USER THREAD_NAME"
+ fi
+else
+ echo You did not provide a user name.
+ echo USAGE: cat "<YOURMESSAGE> | threadcat-write USER THREAD_NAME"
+fi
+
+