If you can install it through GUI, look for a wireless driver that is rt2540. If you don't see it, continue.
In commandline: log into root by typing "su"
Type "iwconfig" and print out results
Type "ifconfig" and print out results
Type "route" and print out results
Chances is, you might just need to type in one string. The above will verify this. If it verifies that you can't just type in one string, then you need to make a script for yourself. That's providing the RPM works. I just finished installing the rt2500 by compiling it into mandrake 10.1. Works great but I had to compile it because the RPM didn't work. I believe you are using the rt2540 driver? See if you can get it set in GUI first.