From a524a972f47d932e9625eb716c1c61d8f4f283ad Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 18 Feb 2013 10:47:53 +0000 Subject: Read hostname from /etc/hostname. --- lib/custodian/protocoltest/smtprelay.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/custodian/protocoltest') 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 -- cgit v1.2.1