| #!/bin/bash |
| |
| # |
| # Copyright (c) 2014-2017 Nest Labs, Inc. |
| # All rights reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| |
| SCRIPT_DIR=`DIR=\`dirname "$0"\` && (cd $DIR && pwd )` |
| |
| JAR_FILE=WeaveDeviceManager.jar |
| if [ \! -f ${JAR_FILE} ]; then |
| if [ -f ${SCRIPT_DIR}/../device-manager/${JAR_FILE} ]; then |
| JAR_FILE=${SCRIPT_DIR}/../device-manager/${JAR_FILE} |
| else |
| echo "Unable to find ${JAR_FILE}" |
| exit -1 |
| fi |
| fi |
| |
| LIB_DIR=. |
| LIB_FILE=libWeaveDeviceManager.so |
| if [ \! -f ${LIB_DIR}/${LIB_FILE} ]; then |
| if [ -f ${SCRIPT_DIR}/../device-manager/${LIB_FILE} ]; then |
| LIB_DIR=${SCRIPT_DIR}/../device-manager |
| else |
| echo "Unable to find ${LIB_FILE}" |
| exit -1 |
| fi |
| fi |
| |
| export WEAVE_IPV4_LISTEN_ADDR=127.0.0.2 |
| |
| java -verbose:jni -Xcheck:jni -Djava.library.path=${LIB_DIR} -jar ${JAR_FILE} nl.Weave.DeviceManager.TestMain |
| |