summaryrefslogtreecommitdiff
blob: f12d1258a1b4b609e82c5b04029b6c9ba8a63c3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python

import shutil, sys, os
from ConfigParser import ConfigParser

GENTOO_TEAM = 11298

if not os.path.isfile("/opt/foldingathome/client1/client.cfg"):
	print "Folding@Home installation hasn't been configured yet"
	sys.exit(1)

clientnum = (1, 2, 3, 4, 5, 6, 7, 8)

cfg = ConfigParser()
cfg.read("/opt/foldingathome/client1/client.cfg")

# if the user didn't chose a team at setup time put them on the gentoo team
if cfg.get("settings", 'team') == '0':
        cfg.set("settings", 'team', GENTOO_TEAM)

for i in clientnum:
	cfgName = "/opt/foldingathome/client%d/client.cfg" % (i)
	shutil.copyfile("/opt/foldingathome/client1/client.cfg", cfgName)

	cfg.set("settings", 'machineid', i)

	cfgFile = open(cfgName, "w")
	cfg.write(cfgFile)