HOME       PACKAGES       SCRIPTS

qstop: A Tool for Disconnecting

Why use qstop instead of the network GUI to disconnect from a network or the web? Sometimes it is just easier to type one word than to pick up your stylus and tap on the icon. But where this tool is essential is in those instances where your network GUI will not give you that option.

Yes, you could also just kill the pppd process if you know how, but that can result in serious problems later on if you are using a Qtopia device. By going through Qtopia to shutdown the connection, you are informing qpe of what is going on, and the system will be much more cooperative the next time or two that you want to access a Network or go online.

Instead of typing out the whole command each time I want to invoke it, I put it in a script that I call qstop, and refer to it as the qstop command.

This command or script, written specifically for Qtopia devices, shuts down networking processes using QPE. It should only be invoked when there is an active, current networking process that you wish to shut down. It was designed to be used when neither "Disconnect" nor "Abort" is displayed as an option on the taskbar's network applet popup, even though you are connected and wish to disconnect.

Warning!! Invoking this command or script at any other times could freeze your machine and require rebooting. Be careful with it! I use it all the time, but I can not guarantee how it will affect setups with more than one pppd process running. Use at your own risk!

While you certainly can use it instead of tapping on the GUI, I do not recommend using it for routine shutdowns of network connections until you feel comfortable with using it with your setup, or do not mind taking the risk of having the other network connection shut down instead.

If you have a Qtopia device on which your setup is different than mine and find that it either works, or does not work, then do send me a message at either OESF here or at here about your setup and your experience with qstop so I can update the information here, toning down or clarifying the warning.

On those systems where the user can successfuly send qcop messages from the command line using regular qcop, then you would substitute in qcop, instead of qcop2, in the following examples.

The script itself is a simple one-line command which uses qcop2 to tell qtopia to disconnect your modem. Some ROM s may already have the ability to issue qcop commands from the command line, but upgrading to qcop2 is essential to enable ROMs 2.38 and 3.10 to process the command properly.

You can either enter the following from the command line, or click here to download a copy of my script.

  qcop2 QPE/Network 'stop()'

Again, if you have more than one network connection running simultaneously, it should shut down the most recently opened one, but that will depend on how qcop handles the message stack, so be careful...it could shut down either connection, depending on how qpe handles it.

You also could create an alias with the qstop command in it, if you prefer that. To do so, simply add the following line to your .bashrc file, and then just type the one word qstop when you want to run the command.

alias qstop="qcop2 QPE/Network 'stop()' "

qstop was written and tested by me on a Zaurus sl5500 using Sharp ROM 2.38 and a dialup modem.

NOTE: Now that I have an sl6000, I am finding that on Sharp ROM 1.12, qstop ONLY sometimes resets the GUI for my dialup connection, in which case I sometimes need to also enter the following command from the command line to end the connection:

cardctl reset

Will add more information here when I have been able to study the difference more carefully.

Revised October 6, 2011