X-Git-Url: http://git.megacz.com/?p=org.ibex.jinetd.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjinetd%2FRoot.java;h=6b5467df5053d7349e76211933a13a82879892a4;hp=b844c9bcd772b2d945c16351b106a53fc76f0f8a;hb=5a70dae9ae337182636a4c4d59951019a24e9f34;hpb=7b717a47e5def749c6913e4019801ce4a9225f01 diff --git a/src/org/ibex/jinetd/Root.java b/src/org/ibex/jinetd/Root.java index b844c9b..6b5467d 100644 --- a/src/org/ibex/jinetd/Root.java +++ b/src/org/ibex/jinetd/Root.java @@ -6,6 +6,7 @@ import java.net.*; public class Root extends Loader { + public static String root = System.getProperty("jinetd.root", "/jinetd"); private final Host host; private final Watched port; @@ -32,7 +33,7 @@ public class Root extends Loader { Log.warn(this, "/host changed"); } else if (w.part.equals("port")) { Log.warn(this, "/port changed"); - } else if (w.getAbsolutePath().startsWith("/jinetd/LIB/")) { + } else if (w.getAbsolutePath().startsWith(Root.root + "/LIB/")) { if (w.lastModifiedAtLastScan != -1) { Log.error(this, "jinetd upgraded; bouncing the JVM...."); reboot(); @@ -49,7 +50,7 @@ public class Root extends Loader { String portnum = part.indexOf(':') == -1 ? part : part.substring(part.indexOf(':') + 1); try { return new Port(this.path + File.separatorChar + part, - ipaddr == null ? null : NetworkInterface.getByInetAddress(InetAddress.getByName(ipaddr)), + ipaddr == null ? null : InetAddress.getByName(ipaddr), portnum.equals("*") ? 0 : Integer.parseInt(portnum)); } catch (UnknownHostException e) { Log.warn(this, "can't resolve host for port directory: " + part); } catch (NumberFormatException e) { Log.warn(this, "invalid port directory: " + part);