Fonction de configuration des bornes :

eval $(get_config)
[ -n $mac ] && echo "Je suis bien connue"

darcs-hash:20041218214813-d1718-28dd1d550c777724c250b2a058c9b495505a75b5.gz
This commit is contained in:
bernat 2004-12-18 22:48:13 +01:00
parent b090696f4f
commit 5cb95c33b0

View file

@ -169,6 +169,7 @@ class bornes_wifi(gen_config) :
# Fichier
AUTOEXEC = '/etc/wifi/ftp/autoexec.sh'
GET_CONFIG='/etc/wifi/wifi-update/shared/config/get_config'
autoexec = u"""#! /bin/sh
#***********************************************************
@ -484,6 +485,7 @@ cat /tmp/autoexec.log | busybox logger -p local3.info -t "Statut"
self.bornes = bornes
def _gen(self) :
# Ancien systeme
date = time.strftime('%A %d %B %Y %H:%M')
# Liste des bornes
BORNES = u'## Liste des bornes -- source : base LDAP\n'
@ -500,6 +502,18 @@ cat /tmp/autoexec.log | busybox logger -p local3.info -t "Statut"
fd.write( (self.autoexec % vars()).encode('iso-8859-15') )
fd.close()
# Nouveau systeme
fd = self._open_conf(self.GET_CONFIG, '#')
fd.write("""
get_config () {
grep -i $(nvram get et0macaddr) <<EOF | awk '{print "mac="$1 " ip="$2 " canal="$3 " puissance="$4 " nom="$5}'
""")
fd.write(BORNES)
fd.write("\nEOF\n}\n")
fd.close()
def restart(self) :
self.lock()
for borne in self.bornes :