From a036fdbc54fdf51acd01b13832544e59d3dae88d Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Mon, 3 Dec 2012 02:36:13 +0100 Subject: [PATCH] [/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 --- impression/ethercodes.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 impression/ethercodes.sh diff --git a/impression/ethercodes.sh b/impression/ethercodes.sh new file mode 100755 index 00000000..0e4a573e --- /dev/null +++ b/impression/ethercodes.sh @@ -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 " --patch-name "[ethercodes.dat] Mise a jour du fichier vendeur" --all --no-ask-deps --skip-long-comment ethercodes.dat > /dev/null + +rm -f $TEMPFILE