... | ... |
@@ -12,20 +12,8 @@ LOG_PATH="/home/$USER/log" |
12 | 12 |
# in the agent script. '60' is the default. Value is in seconds. |
13 | 13 |
POLLING_INTERVAL="60" |
14 | 14 |
|
15 |
- |
|
16 |
-if [ "$HOSTNAME" == "raspi3" ]; then |
|
17 |
- AGENT_NAME="[a]rednsigMirrorAgent.py" |
|
18 |
- SOURCE_URL="http://192.168.1.30:7368/arednsig/" |
|
19 |
-elif [ "$HOSTNAME" == "redwall" ]; then |
|
20 |
- AGENT_NAME="[a]rednsigMirrorAgent.py" |
|
21 |
- SOURCE_URL="http://73.157.139.23:7361/arednsig/" |
|
22 |
-elif [ "$HOSTNAME" == "ka7jlo-web" ]; then |
|
23 |
- AGENT_NAME="[a]rednsigAgent.py" |
|
24 |
- SOURCE_URL="http://ka7jlo-sw-albany-nano-m3.local.mesh/cgi-bin/status" |
|
25 |
-else |
|
26 |
- echo invalid host |
|
27 |
- exit 1 |
|
28 |
-fi |
|
15 |
+AGENT_NAME="[a]rednsigAgent.py" |
|
16 |
+SOURCE_URL="{your Aredn node url}" |
|
29 | 17 |
|
30 | 18 |
PROCESS_ID="$(ps x | awk -v a=$AGENT_NAME '$7 ~ a {print $1}')" |
31 | 19 |
|
... | ... |
@@ -5,9 +5,6 @@ |
5 | 5 |
# whether your local network uses a domain name server. |
6 | 6 |
# |
7 | 7 |
|
8 |
-AGENT_NAME="[a]rednsigAgent.py" |
|
9 |
-SOURCE_URL="http://localnode.local.mesh/cgi-bin/status" |
|
10 |
- |
|
11 | 8 |
APP_PATH="/home/$USER/bin" |
12 | 9 |
LOG_PATH="/home/$USER/log" |
13 | 10 |
|
... | ... |
@@ -15,6 +12,21 @@ LOG_PATH="/home/$USER/log" |
15 | 12 |
# in the agent script. '60' is the default. Value is in seconds. |
16 | 13 |
POLLING_INTERVAL="60" |
17 | 14 |
|
15 |
+ |
|
16 |
+if [ "$HOSTNAME" == "raspi3" ]; then |
|
17 |
+ AGENT_NAME="[a]rednsigMirrorAgent.py" |
|
18 |
+ SOURCE_URL="http://192.168.1.30:7368/arednsig/" |
|
19 |
+elif [ "$HOSTNAME" == "redwall" ]; then |
|
20 |
+ AGENT_NAME="[a]rednsigMirrorAgent.py" |
|
21 |
+ SOURCE_URL="http://73.157.139.23:7361/arednsig/" |
|
22 |
+elif [ "$HOSTNAME" == "ka7jlo-web" ]; then |
|
23 |
+ AGENT_NAME="[a]rednsigAgent.py" |
|
24 |
+ SOURCE_URL="http://ka7jlo-sw-albany-nano-m3.local.mesh/cgi-bin/status" |
|
25 |
+else |
|
26 |
+ echo invalid host |
|
27 |
+ exit 1 |
|
28 |
+fi |
|
29 |
+ |
|
18 | 30 |
PROCESS_ID="$(ps x | awk -v a=$AGENT_NAME '$7 ~ a {print $1}')" |
19 | 31 |
|
20 | 32 |
if [ -n "$PROCESS_ID" ]; then |
... | ... |
@@ -5,13 +5,11 @@ |
5 | 5 |
# whether your local network uses a domain name server. |
6 | 6 |
# |
7 | 7 |
|
8 |
-APP_PATH="/home/$USER/bin" |
|
9 |
-LOG_PATH="/home/$USER/log" |
|
10 |
- |
|
11 | 8 |
AGENT_NAME="[a]rednsigAgent.py" |
9 |
+SOURCE_URL="http://localnode.local.mesh/cgi-bin/status" |
|
12 | 10 |
|
13 |
-#NODE_URL="http://localnode:8080/cgi-bin/signal.json" |
|
14 |
-NODE_URL="http://192.168.1.30:8080/cgi-bin/status" |
|
11 |
+APP_PATH="/home/$USER/bin" |
|
12 |
+LOG_PATH="/home/$USER/log" |
|
15 | 13 |
|
16 | 14 |
# Changing the value overides the default data request interval hardcoded |
17 | 15 |
# in the agent script. '60' is the default. Value is in seconds. |
... | ... |
@@ -26,7 +24,11 @@ if [ -n "$PROCESS_ID" ]; then |
26 | 24 |
else |
27 | 25 |
printf "starting up arednsig agent\n" |
28 | 26 |
cd $APP_PATH |
29 |
- $(./$AGENT_NAME -u $NODE_URL -p $POLLING_INTERVAL >> \ |
|
30 |
- $LOG_PATH/arednsigAgent.log 2>&1 &) |
|
27 |
+ if [ "$1" != "" ]; then |
|
28 |
+ ./$AGENT_NAME $1 -u $SOURCE_URL -p $POLLING_INTERVAL |
|
29 |
+ else |
|
30 |
+ ./$AGENT_NAME -u $SOURCE_URL -p $POLLING_INTERVAL >> \ |
|
31 |
+ $LOG_PATH/arednsigAgent.log 2>&1 & |
|
32 |
+ fi |
|
31 | 33 |
fi |
32 | 34 |