Browse code

update

gandolf authored on 01/23/2020 23:34:32
Showing 1 changed files
... ...
@@ -43,12 +43,19 @@ import time
43 43
 import json
44 44
 
45 45
 _USER = os.environ['USER']
46
+_HOSTNAME = os.uname()[1]
46 47
 
47 48
    ### DEFAULT AREDN NODE URL ###
48 49
 
49
-# ip address of the aredn node
50
+# set url of the aredn node
50 51
 
51
-_DEFAULT_AREDN_NODE_URL = "http://localnode:8080/cgi-bin/signal.json"
52
+if _HOSTNAME == "ka7jlo-raspi1":
53
+    _DEFAULT_AREDN_NODE_URL = "http://localnode:8080/cgi-bin/signal.json"
54
+elif _HOSTNAME == "raspi2": 
55
+    _DEFAULT_AREDN_NODE_URL = "http://192.168.1.30:8080/cgi-bin/signal.json"
56
+else:
57
+    print "unknown host"
58
+    exit(1)
52 59
 
53 60
     ### FILE AND FOLDER LOCATIONS ###
54 61
 
... ...
@@ -604,7 +611,6 @@ def main():
604 611
     getCLarguments()
605 612
 
606 613
     requestIntervalSeconds = dataRequestInterval * 60 # convert to seconds
607
-
608 614
     chartUpdateInterval = dataRequestInterval # get charts interval
609 615
 
610 616
     ## Exit with error if rrdtool database does not exist.