Commit 4e79d2bf authored by aninhacostaribeiro's avatar aninhacostaribeiro
Browse files

Updated wake on lan.

parent dc33acce
......@@ -12,3 +12,5 @@ openstack.tenant = fogbow-project
greenstrategy.gracetime = 1800
greenstrategy.expirationtime = 300
wol.broadcast.address = 123.123.255.255
......@@ -11,17 +11,20 @@ import org.xmpp.packet.IQ.Type;
public class ServerCommunicationComponent extends XMPPComponent {
private GreenStrategy gs;
private Properties prop;
public ServerCommunicationComponent(Properties prop, GreenStrategy gs) {
super(prop.getProperty("xmpp.jid"), prop.getProperty("xmpp.password"),
prop.getProperty("xmpp.host"), Integer.parseInt(prop
.getProperty("xmpp.port")));
this.prop = prop;
this.gs = gs;
addHandlers();
}
public void wakeUpHost(String macAddress) throws IOException {
ProcessBuilder pb = new ProcessBuilder("powerwake", macAddress);
ProcessBuilder pb = new ProcessBuilder("powerwake", "-b",
prop.getProperty("wol.broadcast.address"), macAddress);
pb.start();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment