aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.com>2021-03-20 07:02:01 +0200
committerkaotisk <kaotisk@arching-kaos.com>2021-03-20 07:02:01 +0200
commit057a637f446b4345c3528ccae4b9bf7209aa17c2 (patch)
tree13013cbfdd1596505a3b054b9e11581ff8c89b51
parent7b86fc3bbe6ae7b7cbdc4c97edfabd5365b465bc (diff)
downloadpython-cjdns-peering-tools-057a637f446b4345c3528ccae4b9bf7209aa17c2.tar.gz
python-cjdns-peering-tools-057a637f446b4345c3528ccae4b9bf7209aa17c2.tar.bz2
python-cjdns-peering-tools-057a637f446b4345c3528ccae4b9bf7209aa17c2.zip
Small changes to make things efficient
-rw-r--r--appendPeers.py4
-rwxr-xr-xgen.sh6
2 files changed, 5 insertions, 5 deletions
diff --git a/appendPeers.py b/appendPeers.py
index cc75b9a..c896820 100644
--- a/appendPeers.py
+++ b/appendPeers.py
@@ -10,7 +10,7 @@ with open('cjdroute.conf') as json_file:
temp3 = temp2[0]
temp4 = temp3['connectTo']
with open('peers.json') as peers:
- peers = json.load(peers)
- temp4.update(peers)
+ peer = json.load(peers)
+ temp4.update(peer)
write_json(data)
diff --git a/gen.sh b/gen.sh
index 3988399..13d3ba3 100755
--- a/gen.sh
+++ b/gen.sh
@@ -6,10 +6,10 @@
# Futuristic way B-)
echo "gen.sh - Peering tools"
echo "Checking for existing configuration (WARNING!! All comments will be stripped)"
-if [ -f /etc/cjdroute.conf ] then
- cat /etc/cjdroute.conf | cjdroute --cleanconf > cjdroute.conf
+if [ -f /etc/cjdroute.conf ]; then
+ cat /etc/cjdroute.conf > /etc/cjdroute.conf-back && cat /etc/cjdroute.conf | cjdroute --cleanconf > cjdroute.conf;
else
- cjdroute --genconf | cjdroute --cleanconf > cjdroute.conf
+ cjdroute --genconf | cjdroute --cleanconf > cjdroute.conf;
fi
python appendPeers.py
cat cjdroute.conf > /etc/cjdroute.conf