ATI fglrx update check

I have written a little script to test if there is a driver update available. The only thing you have to make sure of, is that you have dog installed.

script source

#!/bin/bash
# Copyright 2007 Julian Knauer <jpk@goatpron.de>
# http://wiki.goatpron.de/linux/scripts/ati-check
#
# This script checks for ATI Radeon driver updates. If a new version of the
# fglrx driver is available it will download the new version into the current
# working directory.
#
# Feel free to copy/modify this file.
 
URL="http://ati.de/support/drivers/linux/linux-radeon.html"
 
update_available=false
 
remote_fglrx_fileurl=`dog --links $URL | grep -e "driver-installer.*\.run$"`
 
remote_fglrx_version=`echo $remote_fglrx_fileurl |\
		     sed -ne 's#.*driver-installer-\(.*\)-.*#\1#p'`
remote_version_major=`echo $remote_fglrx_version |\
		     sed -ne 's/^\([0-9]\+\)\.[0-9]\+\.[0-9]\+$/\1/p'`
remote_version_minor=`echo $remote_fglrx_version |\
		     sed -ne 's/^[0-9]\+\.\([0-9]\+\)\.[0-9]\+$/\1/p'`
remote_version_build=`echo $remote_fglrx_version |\
		     sed -ne 's/^[0-9]\+\.[0-9]\+\.\([0-9]\+\)$/\1/p'`
 
local_fglrx_version=`fglrxinfo | grep version | sed -ne 's/.*(\(.*\))$/\1/p'`
local_version_major=`echo $local_fglrx_version |\
		    sed -ne 's/^\([0-9]\+\)\.[0-9]\+\.[0-9]\+$/\1/p'`
local_version_minor=`echo $local_fglrx_version |\
		    sed -ne 's/^[0-9]\+\.\([0-9]\+\)\.[0-9]\+$/\1/p'`
local_version_build=`echo $local_fglrx_version |\
		    sed -ne 's/^[0-9]\+\.[0-9]\+\.\([0-9]\+\)$/\1/p'`
 
echo "Loading url: $URL..."
echo "Checking remote version: $remote_fglrx_version against \
local version: $local_fglrx_version..."
 
[ $remote_version_major -gt $local_version_major ] && update_available=true
 
if [ ! $update_available = true ]; then
  [ $remote_version_minor -gt $local_version_minor ] && update_available=true
fi
 
if [ ! $update_available = true ]; then
  [ $remote_version_build -gt $local_version_build ] && update_available=true
fi
 
if [ $update_available = true ]; then
  echo "Update is available!"
  echo "Downloading file to current dir: `pwd`"
  wget -c -nv -N $remote_fglrx_fileurl
else
  echo "No Update available!"
fi
 
exit 0

tp-t60

Discussion

Enter your comment
If you can't read the letters on the image, download this .wav file to get them read to you.
 
 
linux/scripts/ati-check.txt · Last modified: 2007/09/28 23:20 by jpk
Recent changes RSS feed Creative Commons License Valid XHTML 1.0 Valid CSS Driven by DokuWiki