start.sh文件:
#!/bin/bash
CLASSPATH=/root/java/javalib/sms.jar:/root/java/javalib/oracle9.2i.jar:/root/java/javalib/activation.jar:/root/java/javalib/mail.jar:/root/java/javalib/log4j-1.2.8.jar:/root/java/javalib/joda-time-1.0.jar:/root/java/javalib/commons-logging-1.0.4.jar:/root/java/javalib/axis-ant.jar:/root/java/javalib/axis.jar:/root/java/javalib/commons-discovery-0.2.jar:/root/java/javalib/jaxrpc.jar:/root/java/javalib/saaj.jar:/root/java/javalib/ant.jar:/root/java/javalib/xmlsec-1.2.1.jar:/root/java/javalib/wsdl4j-1.5.1.jar:/root/java/javalib/commons-collections-3.1.jar:/root/java/javalib/commons-dbcp-1.2.1.jar:/root/java/javalib/commons-pool-1.2.jar:/root/java/javalib/unittest.jar:/root/java/javalib/asrt.jar:/root/java/javalib/junit.jar
java -cp "$CLASSPATH" cn.com.sendSms > console.log & echo $! > sendSms.pid &
stop.sh文件:
#!/bin/bash
cat sendSms.pid | xargs kill -9
运行sh stop.sh即可
cd /home/esms/gateway/DBRouter2
sh start.sh
sleep 2
cd /home/esms/gateway/DBServer2
sh start.sh
sleep 2