aboutsummaryrefslogtreecommitdiffhomepage
path: root/threadcat-write.sh
blob: e328fc2f32f74594eaada1530275b043768801a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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