Les bornes aussi sont reconfigures grce la base.

darcs-hash:20040906221151-41617-de0873281ed96d5ed85a3d54400b119f3ecf62fb.gz
This commit is contained in:
pauget 2004-09-07 00:11:51 +02:00
parent 275c8c0725
commit 51d023c6c4

View file

@ -143,7 +143,7 @@ class bornes_wifi(gen_config) :
clef = '/etc/wifi/ssh/wifi' # Fichier clef ssh
# Fichier
AUTOEXEC = '/tmp/autoexec.sh'
AUTOEXEC = '/etc/wifi/ftp/autoexec.sh'
autoexec = u"""#! /bin/sh
#***********************************************************
@ -417,7 +417,11 @@ cat /tmp/autoexec.log | busybox logger -t "Statut"
BORNES += u'## MAC - IP - Canal - Puissance - Nom\n'
for b in self.db.search('host=*.wifi.crans.org&puissance=*')['machine'] :
self.anim.cycle()
BORNES += u'%s %s %s %s %s\n' % ( b.mac(), b.ip(), b.canal(),
try :
desc = b.info()[0]
except :
desc = 'Inconnu'
BORNES += u'# %s\n%s %s %s %s %s\n' % ( desc, b.mac(), b.ip(), b.canal(),
b.puissance(), b.nom().split(".")[0] )
BORNES += u'## Fin liste des bornes'
@ -431,7 +435,7 @@ cat /tmp/autoexec.log | busybox logger -t "Statut"
self.lock()
for borne in self.bornes :
anim('\treboot de %s' % borne)
status, output = commands.getstatusoutput('echo ssh -i %s -o StrictHostKeyChecking=no root@%s reboot' % ( self.clef, borne ) )
status, output = commands.getstatusoutput('ssh -i %s -o StrictHostKeyChecking=no root@%s reboot || true' % ( self.clef, borne ) )
if status :
print ERREUR
if self.debug :