blob: bc29b3ec0caaf895ce14f9dc217c5629bf385273 [file] [log] [blame]
update_db() {
local src=$1
local dst=$2
while read line ; do
if [[ -z $(echo "${line}" | sed -re 's/(^#.*|^\w*$)//') ]]; then
echo "${line}" >> "${dst}"
id=$(echo "${line}" | grep -o '"[^"]*"')
grep "${id}" "${dst}" 2>&1 >/dev/null || echo "${line}" >> "${dst}"
done < "${src}"
die() {
echo "$*"
exit 1
cd /usr/share/hddtemp
wget -O hddtemp.db -q || die "Failed to download new hddtemp.db file"
# Try to get the Gentoo HDD DB from WebCVS. If that fails, just use the Gentoo HDD database
# that was installed by the ebuild.
if wget -O hddtmp.db -q; then
mv -f hddtmp.db hddgentoo.db
update_db "hddgentoo.db" "hddtemp.db"