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:
parent
b090696f4f
commit
5cb95c33b0
1 changed files with 14 additions and 0 deletions
|
@ -169,6 +169,7 @@ class bornes_wifi(gen_config) :
|
||||||
|
|
||||||
# Fichier
|
# Fichier
|
||||||
AUTOEXEC = '/etc/wifi/ftp/autoexec.sh'
|
AUTOEXEC = '/etc/wifi/ftp/autoexec.sh'
|
||||||
|
GET_CONFIG='/etc/wifi/wifi-update/shared/config/get_config'
|
||||||
|
|
||||||
autoexec = u"""#! /bin/sh
|
autoexec = u"""#! /bin/sh
|
||||||
#***********************************************************
|
#***********************************************************
|
||||||
|
@ -484,6 +485,7 @@ cat /tmp/autoexec.log | busybox logger -p local3.info -t "Statut"
|
||||||
self.bornes = bornes
|
self.bornes = bornes
|
||||||
|
|
||||||
def _gen(self) :
|
def _gen(self) :
|
||||||
|
# Ancien systeme
|
||||||
date = time.strftime('%A %d %B %Y %H:%M')
|
date = time.strftime('%A %d %B %Y %H:%M')
|
||||||
# Liste des bornes
|
# Liste des bornes
|
||||||
BORNES = u'## Liste des bornes -- source : base LDAP\n'
|
BORNES = u'## Liste des bornes -- source : base LDAP\n'
|
||||||
|
@ -499,6 +501,18 @@ cat /tmp/autoexec.log | busybox logger -p local3.info -t "Statut"
|
||||||
fd = self._open_conf(self.AUTOEXEC)
|
fd = self._open_conf(self.AUTOEXEC)
|
||||||
fd.write( (self.autoexec % vars()).encode('iso-8859-15') )
|
fd.write( (self.autoexec % vars()).encode('iso-8859-15') )
|
||||||
fd.close()
|
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) :
|
def restart(self) :
|
||||||
self.lock()
|
self.lock()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue