Initial import

This commit is contained in:
Artem Prilutskiy 2016-11-01 12:17:27 +03:00
commit 12ffb10726
7 changed files with 795 additions and 0 deletions

33
tellusagent.sh Executable file
View file

@ -0,0 +1,33 @@
#!/bin/sh
DIRECTORY=$(dirname $0)
if [ -f $DIRECTORY/tellusagent.conf ]
then
# Read configuration from text file
# Dot is equivalent of bash's source
. $DIRECTORY/tellusagent.conf
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}