#!/bin/sh DIRECTORY=/opt/TellusAgent CONFIGFILE=tellusagent2.conf if [ -f $DIRECTORY/$CONFIGFILE ] then # Read configuration from text file # Dot is equivalent of bash's source . $DIRECTORY/$CONFIGFILE fi if [ -f /etc/config/tellusagent ] then # Read configuration from UCI/LuCI on OpenWRT CONNECT_PORT=$(uci get tellusagent.@tellusagent[0].connectPort) CONTROL_PORT=$(uci get tellusagent.@tellusagent[0].controlPort) MEDIA_PORT=$(uci get tellusagent.@tellusagent[0].mediaPort) fi if [ -n "$1" ] then # 1 - print to standard output # 2 - print to system log # 6 - run as daemon and print to system log SERVICE_MODE=$1 fi $DIRECTORY/tellusagent \ --connect-port ${CONNECT_PORT} \ --control-port ${CONTROL_PORT} \ --media-port ${MEDIA_PORT} \ --server-address ${SERVER_ADDRESS} \ --service-mode ${SERVICE_MODE}