You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
464 B
Bash
21 lines
464 B
Bash
#!/bin/bash
|
|
|
|
if [[ "$#" -lt "2" ]]; then
|
|
echo "Usage: $0 <[username@]hostname_or_fqdn> <command> [other_ssh_args]" >&2
|
|
exit 3
|
|
fi
|
|
|
|
eval "$(<~/.ssh/.ssh-agent)" >/dev/null
|
|
|
|
where="$1"
|
|
shift
|
|
command="$1"
|
|
shift
|
|
|
|
#echo 'exec /usr/bin/ssh -T ##'"$where"'## ##'"$command"'## ##'"$*##" >> /usr/local/monitoring/log/punotify.log
|
|
#exec /usr/bin/ssh -T $where "$command" $* 2>>/usr/local/monitoring/log/punotify.log
|
|
exec /usr/bin/ssh -T $where "$command" $* 2>&1
|
|
|
|
exit $?
|
|
|