I'm sorry, I should have been, especially as I hate advice that masquerades as a self standing instruction.
Ok, I'm not at all familiar with KDE, so hopefully, all this will work. This time, I'm going to err on the side of giving too much information.
A script is just a series of commands, and doesn't have to be complex at all. From what I can gather, for some reason, you have to remove the r8187 module before adding it, which is a whole issue in itself, but at this point, we're not going to worry about that.
So, the commands you type, as far as I can see are just something like
rmmod (or modprobe -r, which does the same thing) rtl8187, then do modprobe rtl8187
So, you could make a simple script called startwireless.sh or whatever you want to call it, that just runs the commands for you. You can put it in /usr/local/bin, or even in your own home directory, making a directory $HOME/bin. Something like
Code:
#!/bin/sh
modprobe -r rtl8187
sleep 2
modprobe rtl8187
iwconfig <whatever commands you type there>
<and if necessary>
dhcpcd wlan0
Explanation:
I use /bin/sh rather than /bin/bash out of habit from the BSDs, and it also makes a script more portable--that is, I have to write little scripts that will run on AIX and Linux, so prefer /bin/sh. Often in Linux, that's just a link to /bin/bash, though in theory, using /bin/sh makes it more POSIX compliant--with the RH based distros at least, that doesn't seem to be quite true though, as it will accept bash-only things.
modprobe -r rtl8187
That's the same as rmmod rtl8187
sleep 2
That just pauses for 2 seconds to sort of give it time, in case it needs it, and can usually be left out.
modprobe rtl8187
That's what you usually do manually.
iwconfig with your usual commands--again, all a script is, at bottom, is a collection of commands.
Then, if iwconfig just connects it to the WAP (Wireless Access Point) but doesn't give it an address, run dhcpcd on the interface.
After creating the script--we'll say you decide to put it in /usr/local/bin, make it executable
chmod 755 /usr/local/bin/startwireless.sh
Now, when you boot up, you should just have to type something like
startwi <then hit the tab key, which should complete the command>
which will, hopefully, run all these commands for you and connect you.
For example, I use wpa_supplicant on RH based systems. I am never sure how I will be connecting, but usually, when using wireless, it will be at home. So my own startwireless.sh script is just
service wpa_supplicant start
dhclient wlan0
In this case, the wpa_supplicant service reads a configuration file that connects it to my home network, and RH based systems use dhclient rather than dhcpcd.
If doing this, you probably want to comment out the various network lines in /etc/rc.conf, as I think that will start the dhcpd command, and you can't call it if it's already running.
Hope this helps.
It's crude, but should work. The more sophisticated way would be to figure out exactly why you have to rmmod and then modprobe, then set it all up in /etc/rc.conf, but the kludgy method above should work.