diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-10-04 20:22:03 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-10-04 20:22:03 -0700 |
commit | b72d545cdecc50fcae475b40c1eb88688365f56b (patch) | |
tree | 175af560abe630b5de0047d4c3b73cd613d99ace /lognotify.rb | |
parent | 18cdbf17334a0b47e7aaaabf88247ec0341e0e91 (diff) | |
download | lognotify-b72d545cdecc50fcae475b40c1eb88688365f56b.tar.gz lognotify-b72d545cdecc50fcae475b40c1eb88688365f56b.tar.xz |
Add setting for optional SSH options.
Diffstat (limited to 'lognotify.rb')
-rwxr-xr-x | lognotify.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lognotify.rb b/lognotify.rb index e72d8f6..1472117 100755 --- a/lognotify.rb +++ b/lognotify.rb @@ -15,6 +15,10 @@ # hostname = ... Hostname of SSH server. # path = ... Path of log file on server. # +# The following setting is optional: +# +# options = ... Command-line options for SSH command. +# # Afterwards, simply run the script with the identifier as an arugment: # # lognotify.rb identifier @@ -76,7 +80,7 @@ end def retrieve_lines conf, lines command = "cat #{conf[:path]}" command << " | sed '1,#{lines}d'" unless lines.zero? - command = "ssh #{conf[:hostname]} \"#{command}\"" + command = "ssh #{conf[:options]} #{conf[:hostname]} \"#{command}\"" Open3.popen3(command) do |stdin, stdout, stderr| # Raise an error if any part of the command resulted in an error. |