diff --git a/basics.yml b/basics.yml index 891e17c..e84c838 100644 --- a/basics.yml +++ b/basics.yml @@ -738,14 +738,6 @@ done message="$(cat)" - - # If message should be sent by another host - if [ -n "$tohost" ] - then - cat | ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new -p33 $tohost " $@" - fi - - [ "$message" = "''" ] && exit 0 [ -z "$message" ] && exit 0 @@ -753,7 +745,12 @@ then message=$(echo -e "$subj\n$message") fi - + + # If message should be sent by another host + if [ -n "$tohost" ] + then + echo "$message" | ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new -p33 $tohost " $@" + fi ## SSH if [ -n "$SSH_ORIGINAL_COMMAND" ] @@ -773,7 +770,7 @@ ## MATRIX room=$(hostname) [ -n "$togroup" ] && room=$togroup - if ps ax | grep -q synapse.app.homeserver + if ps ax | grep -v grep | grep -q synapse.app.homeserver then sudo /usr/bin/docker compose -f /home/docker/matrix.$(hostname)/docker-compose.yml run -T matrix.$(hostname)--commander -m "$message" -k --room $room --log-level WARNING WARNING fi