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
@ -744,25 +743,18 @@
[ "$message" = "''" ] && exit 0
[ -z "$message" ] && exit 0
# 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' "$@")"
fi
# Subject to message
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 " $@"
fi
## SSH
if [ -n "$SSH_ORIGINAL_COMMAND" ]
then
subj=$(echo "$SSH_ORIGINAL_COMMAND" | sed 's#^/usr/local/bin/notify.sh##; s/^ *//; s/^\"//; s/\"$//')
message=$(echo -e "$subj$message")
fi
## MAIL
if [ -n "$tomail" ]
then