running a script at startup as superuser

Hay Guys,
I have installed OpenSUSE 11.4 using the Gnome Live USB version, and I have updated to Gnome 3.
I use a USB CDMA modem which is not detected automatically (it never did).
after reading a lot of forums regarding similar issues I have been able to solve my problem, I have to run this script after login,

modprobe usbserial vendor=0X05c6 product=0x00a0
as Root

I was wondering is there anyway that this script runs automatically at start up.

any help would be really appreciated.

Quick and dirty: (what I would try)

Hack your command line into the script /etc/init.d/boot.loadmodules

case "$1" in
    # Read variable for sysconfig and load all mentioned modules
    echo Loading required kernel modules
    . /etc/sysconfig/kernel
    for I in $MODULES_LOADED_ON_BOOT ; do
        if ! modprobe -n $I > /dev/null 2>&1 ; then continue ; fi
        modprobe $I;
    modprobe usbserial vendor=0X05c6 product=0x00a0
    rc_status -v1 -r

He asked “after login”. Your solution is to do something at startup of the system, before login.

But I agree that the OP most probably does not want this to be done after login (of whome?, every login of every user of the system?)

This vodoo’s solution comes to the fore, but as he agrees it is dirty and it most likely will be overwritten at some moment in the future.

For this we have a special file /etc/init.d/boot.local. Add your statement there. It will be executed as root immedialtly after boot and before the statups to gain the intended runlevel.

thanks a lot you guys, it has been solved.
I am using vodoo’s quick and dirty method, its working like a charm. but if i have troubles in future i will undo this and try HCW’s way.
thanks to both of you for being so helpful.

Well, problem almost solved. My “quick & dirty” suggestion was meant to try as a proof of concept. Just to see if it works at all. Thank you for the feedback. The idea to hack it into boot.loadmodules had a reason: this script is executed at the very moment when the startup sequence thinks that it is the right moment to install (additional) modules.

Now you can put it into boot.local taking boot.loadmodules as a template. If it still works, you have a good solution.