From af60dc2f533b805229d49813e85d84d3746db3bc Mon Sep 17 00:00:00 2001 From: bernat Date: Thu, 8 Sep 2005 23:25:13 +0200 Subject: [PATCH] Pour la borne "non-configure", on ne met pas de nvram.updates... darcs-hash:20050908212513-d1718-4b9012ce1cf57f764572203d245b335bdcd3b195.gz --- gestion/gen_confs/wifi_ng.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/gestion/gen_confs/wifi_ng.py b/gestion/gen_confs/wifi_ng.py index bb01e493..9ef11719 100755 --- a/gestion/gen_confs/wifi_ng.py +++ b/gestion/gen_confs/wifi_ng.py @@ -91,14 +91,15 @@ class conf_wifi_ng(gen_config) : os.path.join("%s%s" % (WORK, root[len(top):]), name)) # On créé/complète le fichier /etc/nvram.updates - fd = file(os.path.join(WORK, "etc", "nvram.updates"), "a") - data = { 'HOST': borne.nom().split('.')[0], - 'IP': borne.ip(), - 'CANAL': borne.canal(raw=True), - 'PUISSANCE': abs(int(borne.puissance() or 0)), - 'ON': ((int(borne.puissance() or 0) > 0) and 1 or 0), - } - fd.write(""" + if borne != "non-configure.wifi.crans.org": + fd = file(os.path.join(WORK, "etc", "nvram.updates"), "a") + data = { 'HOST': borne.nom().split('.')[0], + 'IP': borne.ip(), + 'CANAL': borne.canal(raw=True), + 'PUISSANCE': abs(int(borne.puissance() or 0)), + 'ON': ((int(borne.puissance() or 0) > 0) and 1 or 0), + } + fd.write(""" variables="${variables} lan_ipaddr wan_hostname crans_channels txpower wl0_radio" NVRAM_lan_ipaddr=%(IP)s NVRAM_wan_hostname=%(HOST)s @@ -106,14 +107,14 @@ NVRAM_crans_channels=%(CANAL)s NVRAM_txpower=%(PUISSANCE)d NVRAM_wl0_radio=%(ON)d """ % data) - # Dans le description, on peut avoir d'autres variables - # pour cette borne. Elles sont préfixées par dans - # la description. - for info in borne.info(): - if info.startswith(""): - fd.write('variables="${variables} %s"\n' % info[7:].split("=")[0]) - fd.write("NVRAM_%s\n" % info[7:]) - fd.close() + # Dans le description, on peut avoir d'autres variables + # pour cette borne. Elles sont préfixées par dans + # la description. + for info in borne.info(): + if info.startswith(""): + fd.write('variables="${variables} %s"\n' % info[7:].split("=")[0]) + fd.write("NVRAM_%s\n" % info[7:]) + fd.close() # On fait du menage os.system("find %s -name CVS -type d -exec rm -rf {} \\; 2> /dev/null" % WORK)