diff options
author | Robert Gogolok <gogo@cs.uni-sb.de> | 2007-06-08 15:22:43 +0000 |
---|---|---|
committer | Robert Gogolok <gogo@cs.uni-sb.de> | 2007-06-08 15:22:43 +0000 |
commit | df6cc1327a3b4ed3489fcc924342d23dc40ef59d (patch) | |
tree | ff1d15dbfab456137d079dc05446f9d222a6ffa6 | |
parent | dd664ce0cf20fb094478a7c1c171ebc016c4972b (diff) | |
download | bcfg2-df6cc1327a3b4ed3489fcc924342d23dc40ef59d.tar.gz bcfg2-df6cc1327a3b4ed3489fcc924342d23dc40ef59d.tar.bz2 bcfg2-df6cc1327a3b4ed3489fcc924342d23dc40ef59d.zip |
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
-rwxr-xr-x | src/sbin/bcfg2-ping-sweep | 9 |
1 files changed, 7 insertions, 2 deletions
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') |