aboutsummaryrefslogtreecommitdiff
path: root/gen.sh
blob: 7af4a9c1311dc900ea814592776e2ce7090c243e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

# Nowadays :) <- we keep this in order to learn something valueable, soon to be deleted!
#cjdroute --genconf | sed -n '/^\/\*.*\*\//!p' | sed -n '/ \/\/.*/!p' | sed 's|/\*|\n&|g;s|*/|&\n|g' | sed '/\/\*/,/*\//d' > cjdroute.conf

# 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 --clean > cjdroute.conf
else
	cjdroute --genconf | cjdroute --cleanconf > cjdroute.conf
fi
python appendPeers.py
cat cjdroute.conf > /etc/cjdroute.conf
echo "Restart cjdns to get the new configuration up..."
systemctl restart cjdns

echo "Suppose it's done!"