So I started writing a Dashboard widget.. and so far, everything is working with the exception of one little part that is driving me nuts.
A quick snippet,
Now, the first part works fine. The process is executed, and the pid is stored within sshPid, however, the second part is where it seems to fail. It doesn't kill the process. For the life of me, I cannot figure out why. I've verified the command, I've even hardcoded it, still, it won't work. Is there a restriction on /bin/kill?
I'm beating my head on a wall over here..
A quick snippet,
Code:
sshPid = widget.system("/usr/bin/ssh [args] &>/dev/null & echo $!", null).outputString; // Grabs pid of executed process
...
widget.system("/bin/kill -9 " + sshPid, null); // kill process
Now, the first part works fine. The process is executed, and the pid is stored within sshPid, however, the second part is where it seems to fail. It doesn't kill the process. For the life of me, I cannot figure out why. I've verified the command, I've even hardcoded it, still, it won't work. Is there a restriction on /bin/kill?
I'm beating my head on a wall over here..