Initial commit. Added obs-chat-monitor script
This commit is contained in:
commit
3f4076c321
|
@ -0,0 +1 @@
|
||||||
|
obs-chat/obs-chat-monitor.conf
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Move pwd to the same dir where the script is located
|
||||||
|
scriptpath=$(dirname "$0")
|
||||||
|
cd "$scriptpath" || exit
|
||||||
|
|
||||||
|
# Source untracked variables
|
||||||
|
source ./obs-chat-monitor.conf
|
||||||
|
|
||||||
|
# Remaining operational vars
|
||||||
|
sedscript="./weechat-massage.sed"
|
||||||
|
foldwidth=50
|
||||||
|
maxlines=15
|
||||||
|
outfile="/tmp/obs-chat.txt"
|
||||||
|
|
||||||
|
|
||||||
|
# Clear $outfile
|
||||||
|
printf '%.0s\n' $(seq $maxlines) > "$outfile"
|
||||||
|
|
||||||
|
ssh "$remotehost" \
|
||||||
|
tail -fn0 "$remotelog" | \
|
||||||
|
sed -u -r -f "$sedscript" | \
|
||||||
|
stdbuf -i0 -o0 \
|
||||||
|
fold -s -w "$foldwidth" | \
|
||||||
|
tee -a "$outfile"
|
|
@ -0,0 +1,3 @@
|
||||||
|
s/^[[:digit:]]+-[[:digit:]]+-[[:digit:]]+ [[:digit:]]+:[[:digit:]]+:[[:digit:]]+\t/\n/g
|
||||||
|
/.?--.?\t/d
|
||||||
|
s/(.*)\t/\1:\n/
|
Loading…
Reference in New Issue