Add a check if telnet/ssh is enabled when starting the bundle.
diff --git a/console/org.eclipse.equinox.console.supportability/src/org/eclipse/equinox/console/ssh/SshCommand.java b/console/org.eclipse.equinox.console.supportability/src/org/eclipse/equinox/console/ssh/SshCommand.java
index dc55d81..2f4d189 100644
--- a/console/org.eclipse.equinox.console.supportability/src/org/eclipse/equinox/console/ssh/SshCommand.java
+++ b/console/org.eclipse.equinox.console.supportability/src/org/eclipse/equinox/console/ssh/SshCommand.java
@@ -82,7 +82,7 @@
}
sshPort = consolePropValue.substring(index + 1);
isEnabled = true;
- }
+ }
if (sshPort != null && !"".equals(sshPort)) {
try {
defaultPort = Integer.parseInt(sshPort);
@@ -96,7 +96,7 @@
Dictionary<String, Object> properties = new Hashtable<String, Object>();
properties.put("osgi.command.scope", "equinox");
properties.put("osgi.command.function", new String[] {"ssh"});
- if (port > 0 || defaultPort > 0) {
+ if ((port > 0 || defaultPort > 0) && isEnabled == true) {
try{
ssh(new String[]{"start"});
} catch (Exception e) {
diff --git a/console/org.eclipse.equinox.console.supportability/src/org/eclipse/equinox/console/telnet/TelnetCommand.java b/console/org.eclipse.equinox.console.supportability/src/org/eclipse/equinox/console/telnet/TelnetCommand.java
index b2dc608..2d4bc58 100644
--- a/console/org.eclipse.equinox.console.supportability/src/org/eclipse/equinox/console/telnet/TelnetCommand.java
+++ b/console/org.eclipse.equinox.console.supportability/src/org/eclipse/equinox/console/telnet/TelnetCommand.java
@@ -77,21 +77,21 @@
}
telnetPort = consolePropValue.substring(index + 1);
isEnabled = true;
- }
+ }
if (telnetPort != null && !"".equals(telnetPort)) {
try {
defaultPort = Integer.parseInt(telnetPort);
} catch (NumberFormatException e) {
// do nothing
}
- }
+ }
}
public synchronized void start() {
Dictionary<String, Object> properties = new Hashtable<String, Object>();
properties.put("osgi.command.scope", "equinox");
properties.put("osgi.command.function", new String[] {"telnet"});
- if (port > 0 || defaultPort > 0) {
+ if ((port > 0 || defaultPort > 0) && isEnabled == true) {
try{
telnet(new String[]{"start"});
} catch (Exception e) {