#!/bin/bash function log { echo -e "\e[1;34m> ${1}\e[0m"; } [[ -d ~/cjdns ]] && log 'already installed!' && exit 0 log 'installing inside ~/cjdns' git clone https://github.com/cjdelisle/cjdns.git ~/cjdns cd ~/cjdns/ log 'compiling...' ./do (umask 077 && ./cjdroute --genconf > cjdroute.conf) sudo cp cjdroute /usr/bin sudo cp cjdroute.conf /etc/ log 'installing systemd service' sudo wget https://raw.githubusercontent.com/cjdelisle/cjdns/master/contrib/systemd/cjdns.service -P /etc/systemd/system/ sudo wget https://raw.githubusercontent.com/cjdelisle/cjdns/master/contrib/systemd/cjdns-resume.service -P /etc/systemd/system/ sudo systemctl enable cjdns sudo systemctl start cjdns log 'done!' log '1. add a node in /etc/cjdroute.conf (inside "connectTo")' log '2. restart cjdns (sudo systemctl restart cjdns)'