diff --git a/etc/otpw/otpw-config.properties b/etc/otpw/otpw-config.properties index 8f788c0..85300b4 100644 --- a/etc/otpw/otpw-config.properties +++ b/etc/otpw/otpw-config.properties @@ -8,3 +8,4 @@ master.password.tmpdir=/home/miluxhd master.db.password=PASSWORD master.db.name=otpw master.db.user=otpwuser +master.messagecommand=/var/lib/otpw/externalScript/sms.sh diff --git a/java/src/main/java/ir/milux/MessageSender.java b/java/src/main/java/ir/milux/MessageSender.java index a6aa684..f1c08b7 100644 --- a/java/src/main/java/ir/milux/MessageSender.java +++ b/java/src/main/java/ir/milux/MessageSender.java @@ -2,9 +2,17 @@ import org.apache.log4j.Logger; +import java.io.IOException; + public class MessageSender { Logger logger = Logger.getLogger (MessageRequest.class); public void send(String id,String password){ - logger.info ("id : " + id + "password : " + password); + Runtime runtime = Runtime.getRuntime (); + String messageCommand = Properties.getProperty ("master.messagecommand") +" '" + id + "' '" + password+"'"; + try { + runtime.exec (messageCommand); + } catch (IOException e) { + logger.error (e.getMessage ()); + } } }