cjdelisle / cjdns.sh

Shell script for installing, updating, and launching cjdns
2 stars 0 forks source link

cjdns.sh

Shell script for auto-installing cjdns.

This script is meant to install cjdns, and keep it updated. It is accessible from https://pkt.cash/special/cjdns/cjdns.sh so you can run it as follows:

curl https://pkt.cash/special/cjdns/cjdns.sh | sh

Or:

wget -qO - https://pkt.cash/special/cjdns/cjdns.sh | sh

Environment Variables

This script reacts to certain environment variables, variables which you will likely want to use include:

Example:

curl https://pkt.cash/special/cjdns/cjdns.sh | CJDNS_PEERID=PUB_helloWorld CJDNS_TUN=1 sh

There are some additional env vars which you probably will not need:

How it works

When systemd/openrc launches cjdns, it runs cjdns.sh, causing it to check itself and update if necessary. It also checks for updates of cjdroute and cjdnstool. Once all executables are up to date, it updates the cjdroute.conf file to match its env vars and it runs cjdns.

When this script is run manually, either by cjdns.sh or by curl https://pkt.cash/special/cjdns/cjdns.sh | sh, it does all of these things, but it also installs /etc/systemd/system/cjdns-sh.service or /etc/init.d/cjdns-sh for systemd or openrc automatic startup. Finally it persists its env variables in /etc/cjdns.sh.env so that they will be used on every launch.

So if you wish to change a setting like the admin port number, you can simply enter:

CJDNS_ADMIN_PORT=11234 cjdns.sh

And the script will re-run, check for updates, and then store the new port number.