#!/bin/sh #----------------------------------------------------------------------------- # /var/install/bin/hwdiag-list - Update hardware list # # Creation: 2004-07-03 jv # Last Update: $Id: hwdiag-updatedb 24471 2010-06-10 21:14:01Z schlotze $ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #----------------------------------------------------------------------------- #include eislib . /var/install/include/eislib n_return=0 clrhome mecho -info "Update hardware database from internet:" mecho "Please wait ..." # download usb.ids if ! wget -O /var/lib/usbutils/usb.ids.new http://www.linux-usb.org/usb.ids then rm -f /var/lib/usbutils/usb.ids.new else if ! grep >/dev/null "^C " /var/lib/usbutils/usb.ids.new then mecho -error "update usb.ids: missing class info, probably truncated file" rm -f /var/lib/usbutils/usb.ids.new else chmod -f --reference=/var/lib/usbutils/usb.ids /var/lib/usbutils/usb.ids.new 2>/dev/null || true fi fi # download pci.ids if ! wget -O /usr/share/misc/pci.ids.gz http://pciids.sourceforge.net/v2.2/pci.ids.gz then rm -f /usr/share/misc/usb.ids.gz else gzip -d /usr/share/misc/pci.ids.new rm -f /usr/share/misc/pci.ids.gz if ! grep >/dev/null "^C " /usr/share/misc/pci.ids.new then mecho -error "update pci.ids: missing class info, probably truncated file" rm -f /usr/share/misc/pci.ids.new else chmod -f --reference=/usr/share/misc/pci.ids /usr/share/misc/pci.ids.new 2>/dev/null || true fi fi mecho -n "usb.ids " if [ -f /var/lib/usbutils/usb.ids.new ] then mv -f /var/lib/usbutils/usb.ids.new /var/lib/usbutils/usb.ids ln -sf /var/lib/usbutils/usb.ids /usr/share/misc/usb.ids ln -sf /var/lib/usbutils/usb.ids /var/lib/misc/usb.ids mecho -info "ok" else mecho -error "no update" n_return=1 fi mecho -n "pci.ids " if [ -f /usr/share/misc/pci.ids.new ] then mv -f /usr/share/misc/pci.ids.new /usr/share/misc/pci.ids mecho -info "ok" else mecho -error "no update" n_return=1 fi echo "" if [ ! $# -gt 0 ] then anykey fi ### ------------------------------------------------------------------------- exit $n_return