aboutsummaryrefslogtreecommitdiffhomepage
path: root/threadcat-write.sh
blob: 81dada2b6a35fde5dad398b470e1e2f97ad61e7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

THREAD_NAME=$1
THREAD_PATH="/opt/threadcat/$THREAD_NAME"


if [ ! -z "${THREAD_NAME}" ]; then
    cat - | ssh $THREADCAT_USER "umask 002 && echo >> $THREAD_PATH && echo `whoami` -- `date`  >> $THREAD_PATH && cat - >> $THREAD_PATH"
    echo Posted to $THREAD_NAME
else
    echo You did not provide a thread name.
    echo USAGE: "cat YOURMESSAGE | threadcat write THREAD_NAME"
fi