diff --git a/basics.yml b/basics.yml index f9d0417..dfc2d11 100644 --- a/basics.yml +++ b/basics.yml @@ -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