Add files via upload

pull/1882/head
Signor Pellegrino 2025-09-13 19:41:45 +01:00 committed by GitHub
parent 38020498a5
commit 1c810059f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
#!/bin/sh
set -e
modprobe wireguard
ip link add dev wg0 type wireguard
( echo "#"
echo "[Interface]"
echo "PrivateKey = $(fw_printenv -n wg_privkey)"
# echo "Address = $(fw_printenv -n wg_address)"
# echo "DNS = $(fw_printenv -n wg_dns)"
echo
echo "[Peer]"
echo "Endpoint = $(fw_printenv -n wg_endpoint)"
echo "PersistentKeepalive = $(fw_printenv -n wg_alive)"
echo "PublicKey = $(fw_printenv -n wg_pubkey)"
echo "PresharedKey = $(fw_printenv -n wg_sharkey)"
echo "AllowedIPs = $(fw_printenv -n wg_allowed)"
echo "#"
) >>/tmp/wireguard.conf
wg setconf wg0 /tmp/wireguard.conf
ip address add dev wg0 $(fw_printenv -n wg_address)
ip link set up dev wg0