This repository has been archived on 2024-01-23. You can view files and clone it, but cannot push or open issues or pull requests.
2016-07-05 16:01:31 +02:00
|
|
|
#!/bin/bash
|
2017-11-30 16:23:50 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
#
|
2017-01-10 06:36:19 +01:00
|
|
|
# Copyright (C) 2015-2017 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
|
2016-11-18 06:22:00 +01:00
|
|
|
|
2016-07-05 16:01:31 +02:00
|
|
|
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
|