aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/contrib/synergy/synergy-server.sh
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-07-05 16:01:31 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2016-07-05 16:01:31 +0200
commit4e04bee9152657a33a787e41625ed37ea0f4380d (patch)
tree9d1c97153ceeac72aa2d05818bd162c06c40ac57 /contrib/synergy/synergy-server.sh
parentwg: always fallback to /dev/urandom (diff)
downloadwireguard-tools-4e04bee9152657a33a787e41625ed37ea0f4380d.tar.xz
wireguard-tools-4e04bee9152657a33a787e41625ed37ea0f4380d.zip
contrib: organize example scripts and add synergy
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'contrib/synergy/synergy-server.sh')
-rwxr-xr-xcontrib/synergy/synergy-server.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/synergy/synergy-server.sh b/contrib/synergy/synergy-server.sh
new file mode 100755
index 0000000..6bef423
--- /dev/null
+++ b/contrib/synergy/synergy-server.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -ex
+if [[ $UID == 0 ]]; then
+ ip link del dev synergy || true
+ ip link add dev synergy type wireguard
+ ip address add 10.193.125.38/32 peer 10.193.125.39/32 dev synergy
+ wg set synergy \
+ listen-port 29184 \
+ private-key <(echo 2InSrlZA5eQfI/MvnvPieqNTBo9cd+udc3SOO9yFpXo=) \
+ peer CBnoidQLjlbRsrqrI56WQbANWwkll41w/rVUIW9zISI= \
+ allowed-ips 10.193.125.39/32
+ ip link set up dev synergy
+else
+ sudo "$(readlink -f "$0")"
+ killall synergys || true
+ synergys -a 10.193.125.38:38382
+fi