This commit is contained in:
XD
2021-07-28 08:55:19 +08:00
commit 6ded8c00a4
87 changed files with 522 additions and 0 deletions

View File

@ -0,0 +1,30 @@
#!/bin/bash
set -eux
# add the interface configuration.
cp /etc/wireguard/wg0.conf{.head,}
# add the peers public keys.
for peer_config_path in /vagrant/wg-conf/wg-peer-*.conf; do
[ ! -f "$peer_config_path" ] && continue
cat >>/etc/wireguard/wg0.conf <<EOF
$(cat "$peer_config_path")
EOF
done
# restart wireguard.
systemctl restart wg-quick@wg0
# show info.
wg show
# show listening ports.
ss -n --tcp --listening --processes
ss -n --udp --listening --processes
# show network interfaces.
ip addr
# show network routes.
ip route