It will create a text file in the current directory. It won't modify anything.
Make sure you are root
(set -x; \
zerotier-cli info -j; \
function h(tag, as, xs) { | |
var attrs = Object.entries(as).map(([k, v]) => ` ${k}="${v}"`); | |
return `<${tag}${attrs}>${xs.join("")}</${tag}>`; | |
} | |
console.log( | |
h("div", { id: "foo" }, [ | |
h("p", { class: "big" }, ["hi", h("p", {}, ["3"])]), | |
h("p", {}, ["bye"]) |
const myMachine = Machine({ | |
type: 'parallel', | |
context: {}, | |
states: { | |
hi: { | |
initial: 'no', | |
states: { | |
yes: {}, | |
no: { on: { CLICK_ME: 'yes' } } |
#compdef zerotier-cli | |
#autoload | |
_get_network_ids () | |
{ | |
if [[ "$OSTYPE" == "darwin"* ]]; then | |
COMPREPLY=($(compgen -W "$(ls -1 /Library/Application\ Support/ZeroTier/One/networks.d | cut -c 1-16)" -- ${cur})) | |
else | |
COMPREPLY=($(compgen -W "$(ls -1 /var/lib/zerotier-one/networks.d | cut -c 1-16)" -- ${cur})) |
Typically, you use zerotier-cli to join and leave networks, but you can also write files to the filesystem to do this.
The networks.d subdirectory of the ZeroTier working directory keeps track of which networks are joined and their settings.
The ZeroTier working directory can be found...
\ProgramData\ZeroTier\One
/Library/Application Support/ZeroTier/One
/var/lib/zerotier-one
curl --silent --header "authorization: bearer ${TOKEN}" "https://my.zerotier.com/api/network/${NWID}/member" | jq ".[] | [ .nodeId, .name, .config.ipAssignments[0] ]" | jq -rs ".[] | @csv" |