summaryrefslogtreecommitdiff
path: root/lib/custodian
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
commita524a972f47d932e9625eb716c1c61d8f4f283ad (patch)
tree1ed76da24612be345b08891d1e905d19916ce1bf /lib/custodian
parentdb01cc0015581b5bf09733b567c3abfb6e006744 (diff)
Read hostname from /etc/hostname.
Diffstat (limited to 'lib/custodian')
-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