From b72d545cdecc50fcae475b40c1eb88688365f56b Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Mon, 4 Oct 2010 20:22:03 -0700 Subject: Add setting for optional SSH options. --- lognotify.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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. -- cgit v1.2.3-70-g09d2