From 86075d93e40765e2abd18ed049d4f15516798db8 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') 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