network: add support for configuring extra peers via a separate json file
[project/unetd.git] / examples / test-net0.sh
1 #!/bin/sh
2 ifname="${1:-wg0}"
3 host="${2:-ap1}"
4
5 ip link add dev $ifname type wireguard > /dev/null 2>&1
6
7 # [ "$ifname" != "net0" ] && ln -sf net0.bin "${ifname}.bin"
8
9 ../unetd -D $PWD -d -h $PWD/hosts -N '{
10 "name": "'"$ifname"'",
11 "type": "dynamic",
12 "auth_key": "'"$(cat ./net0.pub)"'",
13 "key": "'"$(cat ./net0-${host}.key)"'",
14 "file": "'"$PWD/net0.json"'",
15 "tunnels": {
16 "vx0": "l2-tunnel"
17 },
18 "peer_data": [ "'"$PWD/net0.peers"'" ],
19 "update-cmd": "'"$PWD/../scripts/update-cmd.pl"'"
20 }'