summaryrefslogtreecommitdiffstats
path: root/cholerab/knut/clients/cnot/index
blob: f276dd257c74d0060dad9ccbe9f2d3b0b9c17408 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /bin/sh
#
# cnot - cholerab live command line notification client, bitch!
#
# usage: [verbose=yes] cnot hostname [message...]
#
set -euf

host="$1"; shift
port=42101

params="$*"

flags=-sS

if test "${verbose-no}" != no; then
  flags="${flags+$flags }-v"
fi

exec curl $flags -X PUT --data-binary @- "http://$host:$port" <<EOF
{"method":"clive","params":"$params","id":null}
EOF