Autoboot script to detect ATI or nVidia?

I am very experienced to linux but I don’t know how to write scripts…

I would like to know how to detect which GPU the PC has and then download the drivers from zypper upon first boot of the system. Right now my appliance is using Gnome but in the future I would like to use XFCE.

Thank you!

Quick and dirty (you might have to check Internet connection first, etc) :

#! /bin/bash

which lsb_release > /dev/null 2>&1 || zypper in lsb-release
which hwinfo > /dev/null 2>&1 || zypper in hwinfo

gpu=$(hwinfo --gfxcard | sed -n 's|.*Model:  *"\(.*\)"|\1|p' | tr ":upper:]" ":lower:]")
ver=$(lsb_release -s -r)

case $gpu in
*ati*)
	echo "install ATI driver "
	zypper ar http://www2.ati.com/suse/$ver ati
	zypper refresh -r ati
	zypper in x11-video-fglrxG02
	;;
*nvidia*)
	echo "install Nvidia driver "
	zypper ar http://download.nvidia.com/opensuse/$ver nvidia
	zypper refresh -r nvidia
	zypper in x11-video-nvidiaG02
	;;
*intel*)
	echo "install Intel driver "
	# don't know
	;;
*)
	echo "do something else"
	;;
esac

Thank you.
Another question: How would I make sure this starts after the system configures the network if you don’t mind?

If you start the script at the end of the init process (at runlevel 3 or 5) , then the network should be configured at this point. But I’m sorry, I didn’t pay attention that you posted this question in the “suse-studio” forum. It’s about building a system, isn’t it? I thought it was an ordinary scripting question. There might be other ways to set up everything with suse-studio. I’ve never done that.