[/usr/scripts/impression/ethercodes.sh] Avoir tout la commande dans la crontab c'est nettement moins clair qu'un script

Ignore-this: a6c12e349652d9d87ac34768e402a00c

darcs-hash:20121203013613-2c9c1-aebd48efbea95b87fd33613216e0bd6c0529ac05.gz
This commit is contained in:
Vincent Le Gallic 2012-12-03 02:36:13 +01:00
parent e8351b45b6
commit a036fdbc54

13
impression/ethercodes.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
# 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...
TEMPFILE=`tempfile`
umask 002
wget -o /dev/null -O $TEMPFILE http://standards.ieee.org/regauth/oui/oui.txt \
&& awk -F '[\t ]*(hex)[ \t]*' '(/(hex)/) {gsub("-",":",$1) ; print $1" "$2}' < $TEMPFILE > /usr/scripts/gestion/ethercodes.dat \
&& cd /usr/scripts/gestion \
&& darcs record --author "Cron Daemon <root@crans.org>" --patch-name "[ethercodes.dat] Mise a jour du fichier vendeur" --all --no-ask-deps --skip-long-comment ethercodes.dat > /dev/null
rm -f $TEMPFILE