#!/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/hwdata-updatedb - Update hardware list # # Creation: 2004-07-03 jv # Last Update: $Id$ # # Copyright (c) 2004 Jens Vehlhaber, jvehlhaber(at)buchenwald(dot)de # Copyright (c) 2014-@@YEAR@@ the eisfair team, team(at)eisfair(dor)org # # 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 /usr/share/hwdata/usb.ids.new http://www.linux-usb.org/usb.ids then rm -f /usr/share/hwdata/usb.ids.new else if ! grep >/dev/null "^C " /usr/share/hwdata/usb.ids.new then mecho --error "update usb.ids: missing class info, probably truncated file" rm -f /usr/share/hwdata/usb.ids.new else chmod -f --reference=/usr/share/hwdata/usb.ids /usr/share/hwdata/usb.ids.new 2>/dev/null || true fi fi # download pci.ids if ! wget -O /usr/share/hwdata/pci.ids.gz https://pci-ids.ucw.cz/v2.2/pci.ids.gz then rm -f /usr/share/hwdata/pci.ids.gz else gzip -d /usr/share/hwdata/pci.ids.new rm -f /usr/share/hwdata/pci.ids.gz if ! grep >/dev/null "^C " /usr/share/hwdata/pci.ids.new then mecho --error "update pci.ids: missing class info, probably truncated file" rm -f /usr/share/hwdata/pci.ids.new else chmod -f --reference=/usr/share/hwdata/pci.ids /usr/share/hwdata/pci.ids.new 2>/dev/null || true fi fi mecho -n "usb.ids " if [ -f /usr/share/hwdata/usb.ids.new ] then mv -f /usr/share/hwdata/usb.ids.new /usr/share/hwdata/usb.ids mecho --info "ok" else mecho --error "no update" n_return=1 fi mecho -n "pci.ids " if [ -f /usr/share/hwdata/pci.ids.new ] then mv -f /usr/share/hwdata/pci.ids.new /usr/share/hwdata/pci.ids mecho --info "ok" else mecho --error "no update" n_return=1 fi echo if [ ! $# -gt 0 ] then anykey fi exit $n_return # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------