matrix ssh

This commit is contained in:
olli 2024-08-19 15:51:06 +02:00
parent 559272409e
commit b06655f7bd

View File

@ -709,8 +709,7 @@
then
opts=$SSH_ORIGINAL_COMMAND
unset SSH_ORIGINAL_COMMAND
echo $opts >/tmp/SSH
notify.sh $opts
eval /usr/bin/bash $(printf '/usr/local/bin/notify.sh %q' "$opts" | sed 's#\\\\##g; s# \\ # #g; s# \\ # #g')
exit $?
fi
@ -743,26 +742,19 @@
orig_message="$message"
[ "$message" = "''" ] && exit 0
[ -z "$message" ] && exit 0
if [ -n "$subj" ]
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 " $@"
echo "$message" | ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new -p33 $tohost " $(printf ' %q' "$@")"
fi
## SSH
if [ -n "$SSH_ORIGINAL_COMMAND" ]
# Subject to message
if [ -n "$subj" ]
then
subj=$(echo "$SSH_ORIGINAL_COMMAND" | sed 's#^/usr/local/bin/notify.sh##; s/^ *//; s/^\"//; s/\"$//')
message=$(echo -e "$subj$message")
message=$(echo -e "$subj\n$message")
fi
## MAIL
if [ -n "$tomail" ]
then