diff options
author | Steve Kemp <steve@steve.org.uk> | 2013-02-18 10:47:53 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2013-02-18 10:47:53 +0000 |
commit | a524a972f47d932e9625eb716c1c61d8f4f283ad (patch) | |
tree | 1ed76da24612be345b08891d1e905d19916ce1bf | |
parent | db01cc0015581b5bf09733b567c3abfb6e006744 (diff) |
Read hostname from /etc/hostname.
-rw-r--r-- | lib/custodian/protocoltest/smtprelay.rb | 4 |
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 |