From 72b60c2665f4f824fd70bbd14fb71c1c6e382116 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 28 Apr 2006 12:13:39 +0000 Subject: [PATCH] optionally set name via name= directive in rc file --- hbc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hbc b/hbc index 4946f53..f8d3411 100755 --- a/hbc +++ b/hbc @@ -1,5 +1,5 @@ #!/usr/bin/env python -# $Id: hbc,v 1.5 2005/07/21 15:27:05 andreas Exp $ +# $Id: hbc,v 1.6 2006/04/28 12:13:39 andreas Exp $ import sys, time, socket, os, signal, getopt, string PORT=50003 @@ -79,6 +79,7 @@ reportstrict={True|False} hb_port=PORT interval=INTERVAL hb_hosts=[] +iam=socket.gethostname() try: f=open(configfile,"r") @@ -101,6 +102,9 @@ if f: interval=eval(r[1]) elif r[0] == 'hb_port': hb_port=eval(r[1]) + elif r[0] == 'name': + iam=eval(r[1]) + if verbose: print "name set to %s" % iam f.close() if len(args) != 0: @@ -112,7 +116,6 @@ if len(hb_hosts) == 0: sock=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) -iam=socket.gethostname() if verbose: print "notice: hb_hosts: %s" % str(hb_hosts)