#!/bin/sh #----------------------------------------------------------------------------- # /var/install/bin/hwdiag-list - Update hardware list # # Copyright (c) 2004 Jens Vehlhaber # # Creation: 03.07.2004 jv # Last Update: $Id$ # # 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:" cd /var/lib/hwdiag mecho "Please wait ..." rm -f *.1 >/dev/null 2>&1 # download updates: if ! wget -O /var/lib/hwdiag/pcitable.1 http://user-contributions.org/projects/lshwd/tables/pcitable then rm -f /var/lib/hwdiag/pcitable.1 else chmod -f --reference=/var/lib/hwdiag/pcitable /var/lib/hwdiag/pcitable.1 2>/dev/null || true fi if ! wget -O /var/lib/hwdiag/usbtable.1 http://user-contributions.org/projects/lshwd/tables/usbtable then rm -f /var/lib/hwdiag/usbtable.1 else chmod -f --reference=/var/lib/hwdiag/usbtable /var/lib/hwdiag/usbtable.1 2>/dev/null || true fi if ! wget -O /var/lib/hwdiag/pcmciatable.1 http://user-contributions.org/projects/lshwd/tables/pcmciatable then rm -f /var/lib/hwdiag/pcmciatable.1 else chmod -f --reference=/var/lib/hwdiag/pcmciatable /var/lib/hwdiag/pcmciatable.1 2>/dev/null || true fi # download usb.ids if ! wget -O /usr/share/usb.ids.new http://www.linux-usb.org/usb.ids then rm -f /usr/share/usb.ids.new else if ! grep >/dev/null "^C " /usr/share/usb.ids.new then mecho -error "update usb.ids: missing class info, probably truncated file" rm -f /usr/share/usb.ids.new else chmod -f --reference=/usr/share/usb.ids /usr/share/usb.ids.new 2>/dev/null || true fi fi # download pci.ids if ! wget -O /usr/share/pci.ids.gz http://pciids.sourceforge.net/v2.2/pci.ids.gz then rm -f /usr/share/usb.ids.gz else gzip -d /usr/share/pci.ids.new rm -f /usr/share/pci.ids.gz if ! grep >/dev/null "^C " /usr/share/pci.ids.new then mecho -error "update pci.ids: missing class info, probably truncated file" rm -f /usr/share/pci.ids.new else chmod -f --reference=/usr/share/pci.ids /usr/share/pci.ids.new 2>/dev/null || true fi fi mecho -n "usb.ids " if [ -f /usr/share/usb.ids.new ] then mv -f /usr/share/usb.ids.new /usr/share/usb.ids mecho -info "ok" else mecho -error "no update" n_return=1 fi mecho -n "pci.ids " if [ -f /usr/share/pci.ids.new ] then mv -f /usr/share/pci.ids.new /usr/share/pci.ids mecho -info "ok" else mecho -error "no update" n_return=1 fi mecho -n "pcitable " if [ -f /var/lib/hwdiag/pcitable.1 ] then mv -f pcitable.1 pcitable mecho -info "ok" else mecho -error "no update" n_return=1 fi mecho -n "usbtable " if [ -f /var/lib/hwdiag/usbtable.1 ] then mv -f usbtable.1 usbtable mecho -info "ok" else mecho -error "no update" n_return=1 fi mecho -n "pcmciatable " if [ -f /var/lib/hwdiag/pcmciatable.1 ] then mv -f pcmciatable.1 pcmciatable mecho -info "ok" else mecho -error "no update" n_return=1 fi echo "" if [ ! $# -gt 0 ] then anykey fi ### ------------------------------------------------------------------------- exit $n_return