blob: 73163faab12e388dcf8c663678af8abcedbd3024 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#! /bin/sh
set -euf
# require flock from util-linux
if test "${FLOCK-}" != "$state_file"; then
exec env FLOCK="$state_file" flock "$state_file" "$0" "$@"
fi
from="$_prefix"
to=${1%% *}
msg=${1#* }
date=$(date)
# TODO tell now, if already joined
printf '%s %s <%s> %s\n' "$to" "$from" "$date" "$msg" >> "$state_file"
echo 'Consider it noted.' # that's what lambdabot says...
|