malignor: if you're using Ubuntu 9.04, you can set arbitrary hotkey commands using the utility at System>Preferences>Keyboard Shortcuts. This means you can create a hotkey combination that would run your script. I'm thinking this may be the best solution for you, since it would allow you easily to insert the ndiswrapper module when you're ready. Otherwise you can just add a start-up program to Gnome Sessions (the start-up programs there don't run until Gnome has finished loading everything else).
As for the script itself, something like this would probably work:
Code:
ndiswrapper -i [path to driver]
if (ifconfig | grep wlan0)
then ndiswrapper -r [driver name]
else sleep 10; /path/to/script.sh
fi
This would check to see whether the interface is "enabled" based on whether it appears in the ifconfig output. This maybe isn't the cleanest way to check, but it should work for your purposes. If the interface appears to be enabled, the script will ndiswrapper -r the driver. If the interface is not yet enabled, the script will sleep for 10 seconds, then call itself again to check if the interface has come up in that time.
Let me know if this makes sense, or if you need more clarification.
Bookmarks