remote group
This commit is contained in:
parent
ea87404f11
commit
8f9fb58a13
@ -746,7 +746,8 @@
|
||||
# If message should be sent by another host
|
||||
if [ -n "$tohost" ]
|
||||
then
|
||||
echo "$message" | ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new -p33 $tohost " $(printf ' %q' "$@")"
|
||||
[ -z "$togroup" ] && group="-g $(hostname)"
|
||||
echo "$message" | ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new -p33 $tohost " $(printf ' %q' "$@ $group")"
|
||||
fi
|
||||
|
||||
# Subject to message
|
||||
@ -766,16 +767,17 @@
|
||||
room=$(hostname)
|
||||
[ -n "$togroup" ] && room=$togroup
|
||||
room=${room// /}
|
||||
room=${room//\\/}
|
||||
if ps ax | grep -v grep | grep -q synapse.app.homeserver
|
||||
then
|
||||
if [ -p "/usr/local/share/$(hostname).fifo" ]
|
||||
if [ -p "/usr/local/share/matrix-room-$(hostname).fifo" ]
|
||||
then
|
||||
matrix_message=$(echo "<h3>${subj}</h3><pre>${orig_message}</pre>")
|
||||
matrix_target="/usr/local/share/matrix-room-$(hostname).fifo"
|
||||
[ -n "$togroup" ] && [ -p "/usr/local/share/matrix-room-${room}.fifo" ] && matrix_target="/usr/local/share/matrix-room-${room}.fifo"
|
||||
echo "$matrix_message" | perl -pe 's/\n/<br>/' | perl -pe 's/\<br\>$/\n/; s/^\<br\>//;' >"$matrix_target"
|
||||
else
|
||||
echo "$default group seems nit to exist"
|
||||
echo "default group (/usr/local/share/matrix-room-$(hostname).fifo) seems not to exist"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user