Cleaned up RouterManager, should now be crossplatform.

This commit is contained in:
mathiasdm
2010-11-30 17:08:22 +00:00
parent e06ce250ab
commit 620128a767
2 changed files with 9 additions and 4 deletions

View File

@ -1,7 +1,8 @@
HIGH PRIORITY:
- Allow desktopgui to start, stop and restart I2P. - DONE
- Correct logging system - DONE
- Internationalisation
- Correct logging system
- Modify installer to set I2P directory parameter; or use $I2P?
UNKNOWN:
- API to allow applications to add themselves to the menu?
* registerApplication(); -- should return a positive number on success, -1 on failure

View File

@ -30,10 +30,14 @@ public class RouterManager {
*/
public static void start() {
try {
String location = ConfigurationManager.getInstance().getStringConfiguration("I2PLocation", "/home/i2p");
//TODO: detect I2P directory
//TODO: crossplatform
Runtime.getRuntime().exec(location + "/i2psvc " + location + "/wrapper.config");
//TODO: set/get PID
String separator = System.getProperty("file.separator");
String homeDirectory = System.getProperty("user.home");
String location = ConfigurationManager.getInstance()
.getStringConfiguration("I2PLocation", homeDirectory + separator + "i2p");
Runtime.getRuntime().exec(location + separator + "i2psvc" + location + separator + "wrapper.config");
} catch (IOException e) {
log.log(Log.WARN, "Failed to start I2P", e);
}