Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Benjamin Graillot
scripts
Commits
22697448
Commit
22697448
authored
Jan 06, 2017
by
Daniel STAN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
supprime ethercodes.dat
parent
c0825141
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
22926 deletions
+2
-22926
gestion/ethercodes.dat
gestion/ethercodes.dat
+0
-22889
gestion/ldap_crans.py
gestion/ldap_crans.py
+2
-16
utils/ethercodes.sh
utils/ethercodes.sh
+0
-21
No files found.
gestion/ethercodes.dat
deleted
100644 → 0
View file @
c0825141
This diff is collapsed.
Click to expand it.
gestion/ldap_crans.py
View file @
22697448
...
...
@@ -3063,22 +3063,8 @@ class Machine(BaseClasseCrans):
raise
ValueError
(
u
"Il s'agit de l'adresse MAC d'une interface PPP."
,
2
)
# Le test final : vendeur connu
prefix
=
mac
[:
8
].
upper
()
+
' '
vendor
=
''
try
:
for
line
in
open
(
'/usr/scripts/gestion/ethercodes.dat'
).
readlines
():
if
line
.
startswith
(
prefix
):
vendor
=
line
.
replace
(
prefix
,
''
).
replace
(
'( )'
,
''
).
strip
()
break
except
IOError
:
# Le fichier existe pas, on sort
raise
RuntimeError
(
u
"Fichier de fabriquants de MAC non trouvé !"
)
if
not
multi_ok
and
not
vendor
:
raise
ValueError
(
"""Le constructeur correspondant à cette adresse MAC ne peut être trouvé.
L'adresse MAC correspond peut-être à un pont réseau, désactivez ce pont réseau.
Contactez nounou si la MAC est bien celle d'une carte."""
,
3
)
# Code supprimé (et je n'ai pas envie de le réécrire en utilisant
# /var/lib/ieee-data/oui.txt) -- DS
# La mac serait-elle déjà connue ?
if
not
multi_ok
and
self
.
exist
(
'macAddress=%s'
%
mac
):
...
...
utils/ethercodes.sh
deleted
100755 → 0
View file @
c0825141
#!/bin/bash
# Script appelé par cron pour mettre à jour le fichier vendeur
# Avant la comande était entièrement dans la crontab, dans un script ça avait l'air mieux...
#
# Le cron est désormais appelé sur geet (afin de permettre un push facile)
# avec le chemin vers le dépôt et la branche à pusher (master).
# Un lancement sans argument est toutefois accepté.
TEMPFILE
=
`
tempfile
`
# on évite de casser le dépôt (umask)
umask
002
wget
-o
/dev/null
-O
$TEMPFILE
http://standards.ieee.org/regauth/oui/oui.txt
\
&&
awk
-F
'[\t ]*(hex)[ \t]*'
'(/(hex)/) {gsub("-",":",$1) ; {gsub("^ *", "", $1)}; {gsub("\\(", "", $1)}; {gsub("\\)", "", $2)}; print $1" "$2}'
<
$TEMPFILE
>
/usr/scripts/gestion/ethercodes.dat
\
&&
cd
/usr/scripts/gestion
\
&&
git commit
--author
=
"Cron Daemon <root@crans.org>"
-m
"[ethercodes.dat] Mise à jour du fichier vendeur"
ethercodes.dat
>
/dev/null
\
&&
git push
"
$@
"
>
/dev/null
rm
-f
$TEMPFILE
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment