From 08e3885c1b415cf7ca5d0d6407dbba89312a395d Mon Sep 17 00:00:00 2001 From: cyanide-burnout Date: Mon, 1 Aug 2016 14:11:27 +0400 Subject: [PATCH] Added support of uCI --- cronosagent.conf | 6 ++++++ cronosagent.sh | 19 ++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 cronosagent.conf diff --git a/cronosagent.conf b/cronosagent.conf new file mode 100644 index 0000000..363dca6 --- /dev/null +++ b/cronosagent.conf @@ -0,0 +1,6 @@ + +REPEATER_NUMBER=123456 +REPEATER_ADDRESS=172.33.20.136 +SERVER_ADDRESS=master.dstar.su +SERVER_PASSWORD=passw0rd +SERVICE_MODE=1 diff --git a/cronosagent.sh b/cronosagent.sh index ce0590a..471beb5 100755 --- a/cronosagent.sh +++ b/cronosagent.sh @@ -1,10 +1,19 @@ #!/bin/bash -REPEATER_NUMBER=123456 -REPEATER_ADDRESS=172.33.20.136 -SERVER_ADDRESS=master.dstar.su -SERVER_PASSWORD=passw0rd -SERVICE_MODE=1 +if [ -f cronosagent.conf ] +then + # Read configuration from text file + source cronosagent.conf +fi + +if [ -f /etc/config/brandmeister ] +then + # Read configuration from uCU/LuCI on OpenWRT + REPEATER_NUMBER=$(uci get cronosagent.number) + REPEATER_ADDRESS=$(uci get cronosagent.repeaterAddress) + SERVER_ADDRESS=$(uci get cronosagent.serverAddress) + SERVER_PASSWORD=$(uci get cronosagent.serverPassword) +fi if [ -n "$1" ] then