updated script for shell cmd logging
This commit is contained in:
parent
ee9e3d7c8b
commit
9935cc8784
|
@ -161,13 +161,11 @@ public class TorServiceUtils implements TorServiceConstants {
|
|||
|
||||
public static int doShellCommand(String[] cmds, StringBuilder log, boolean runAsRoot, boolean waitFor) throws Exception
|
||||
{
|
||||
TorService.logMessage("executing shell cmds: " + cmds[0] + "; runAsRoot=" + runAsRoot);
|
||||
|
||||
TorService.logMessage("executing shell cmds: " + cmds[0] + "; runAsRoot=" + runAsRoot + ";waitFor=" + waitFor);
|
||||
|
||||
Process proc = null;
|
||||
int exitCode = -1;
|
||||
|
||||
|
||||
if (runAsRoot)
|
||||
proc = Runtime.getRuntime().exec("su");
|
||||
else
|
||||
|
@ -206,11 +204,7 @@ public class TorServiceUtils implements TorServiceConstants {
|
|||
}
|
||||
|
||||
exitCode = proc.waitFor();
|
||||
log.append("process exit code: ");
|
||||
log.append(exitCode);
|
||||
log.append("\n");
|
||||
|
||||
TorService.logMessage("command process exit value: " + exitCode);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue