mirror of https://github.com/OpenIPC/firmware.git
Add files via upload
parent
38020498a5
commit
1c810059f4
|
@ -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
|
Loading…
Reference in New Issue