From df6cc1327a3b4ed3489fcc924342d23dc40ef59d Mon Sep 17 00:00:00 2001 From: Robert Gogolok Date: Fri, 8 Jun 2007 15:22:43 +0000 Subject: bcfg2-ping-sweep: -C option to specify configfile; FreeBSD ping git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3271 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-ping-sweep | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/sbin/bcfg2-ping-sweep') diff --git a/src/sbin/bcfg2-ping-sweep b/src/sbin/bcfg2-ping-sweep index ddb8c36e8..664a3a803 100755 --- a/src/sbin/bcfg2-ping-sweep +++ b/src/sbin/bcfg2-ping-sweep @@ -8,8 +8,13 @@ from os import dup2, execl, fork, uname, wait import lxml.etree, sys, time, ConfigParser if __name__ == '__main__': + if '-C' in sys.argv: + cfpath = sys.argv[sys.argv.index('-C') + 1] + else: + cfpath = '/etc/bcfg2.conf' + c = ConfigParser.ConfigParser() - c.read(['/etc/bcfg2.conf']) + c.read([cfpath]) configpath = "%s/etc/report-configuration.xml" % c.get('server', 'repository') clientdatapath = "%s/Metadata/clients.xml" % c.get('server', 'repository') @@ -35,7 +40,7 @@ if __name__ == '__main__': dup2(null.fileno(), sys.__stderr__.fileno()) if osname == 'Linux': execl('/bin/ping', 'ping', '-w', '5', '-c', '1', host) - elif osname == 'Darwin': + elif osname in ['Darwin', 'FreeBSD']: execl('/sbin/ping', 'ping', '-t', '5', '-c', '1', host) elif osname == 'SunOS': execl('/usr/sbin/ping', 'ping', host, '56', '1') -- cgit v1.2.3-1-g7c22