!7 p-magellan-thread { // Magellan is a pretty face tt(); // type writer font centerHigherConsole(); consoleIcon(#1101431); hideFrameOnMinimize(consoleFrame()); installTrayIcon(#1101431, "JavaX Super User VM", r showConsole, "Exit JavaX Super User VM", rThread cleanKill); // Figure out where we come from File originalHomeDir = newFile(first(args)); // Show who we are S user = systemUserName(); print("User: " + user); print("Home: " + userHome()); if (neq(user, "root")) { print("Failure: I'm not root!"); ret; } // Copy VM arguments from last home if (fileExists(originalHomeDir)) { File out = getProgramFile(#1005850, "default-vm-args"); File in = newFile(javaxDataDirForUserHome(originalHomeDir), #1005850, "default-vm-args"); if (!out.exists() && in.exists()) copyFile(in, out); } // Rename ourselves & be open for business renameVM("Super User VM."); consoleTitle("JavaX Super User VM [" + user + "]"); bot("Super User VM."); print("\nType Linux commands here to execute them.\n"); focusConsole(); sleep(); } answer { if "ready" ret "yes"; if "backtick *" ret format("OK *", backtick_verbose($1)); if "backtick uninterruptible *" { temp tempSetTL(backtick_uninterruptable, true); ret format("OK *", backtick_verbose($1)); } if "program *" { directNohupJavax($1); ret "OK, starting " + $1; } try answer "Exit code: " + backtickToConsole_returnExitCode(s); }