Skip to content

Commit

Permalink
Patch from sideos
Browse files Browse the repository at this point in the history
  • Loading branch information
thebalaa committed Jul 12, 2024
1 parent a6ddc50 commit a91c3d3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/client-link/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ set -euxo pipefail

echo $GATEWAY_CLIENT_WG_PRIVKEY > /etc/wireguard/link0.key

cleanupLink() {
if ip link show link0 > /dev/null 2>&1; then
ip link delete link0
fi
}

ip link add link0 type wireguard
if ! ip link show link0 > /dev/null 2>&1; then
trap cleanupLink EXIT
ip link add link0 type wireguard
fi

wg set link0 private-key /etc/wireguard/link0.key
wg set link0 listen-port 18521
Expand Down

0 comments on commit a91c3d3

Please sign in to comment.