I have the same problem. I want to disable network and then enable it.
ifconfig ethPCI down
ifconfig ethPCI up
Here is my code:
args<<"ethPCI"<<"down";
process->start("ifconfig",args);
process->waitForFinished();
args<<"ethPCI"<<"up";
process->start("ifconfig",args);
QStringList args;
args<<"ethPCI"<<"down";
QProcess *proc = new QProcess();
process->start("ifconfig",args);
process->waitForFinished();
args<<"ethPCI"<<"up";
process->start("ifconfig",args);
To copy to clipboard, switch view to plain text mode
For some reason only the first command is executed which disables the interface. Second command is not executing.
If I move the second command up then it works but I have to disable the network before enabling it otherwise its no use for me.
Thanks for any help on this.
Bookmarks