summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2013-02-18 10:47:53 +0000
committerSteve Kemp <steve@steve.org.uk>2013-02-18 10:47:53 +0000
commit86075d93e40765e2abd18ed049d4f15516798db8 (patch)
tree6536a5117ffe194d94d1084f7fc0a47900aedbfa
parent8aa89dc0aa76ad0b81e906a1795cae04df4d7113 (diff)
Read hostname from /etc/hostname.
-rw-r--r--lib/custodian/protocoltest/smtprelay.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/custodian/protocoltest/smtprelay.rb b/lib/custodian/protocoltest/smtprelay.rb
index d3a223a..7cf22cc 100644
--- a/lib/custodian/protocoltest/smtprelay.rb
+++ b/lib/custodian/protocoltest/smtprelay.rb
@@ -64,6 +64,10 @@ module Custodian
hostname = "localhost.localdomain"
if ( File.exists?( "/etc/hostname" ) )
+ File.readlines("/etc/hostname" ).each do |line|
+ hostname = line if ( !line.nil? )
+ hostname.chomp!
+ end
end
hostname