2020-05-18 23:57:29 +02:00
|
|
|
#!/bin/bash
|
2019-07-12 11:08:41 +02:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2020-05-18 23:57:29 +02:00
|
|
|
# Parse arguments
|
|
|
|
args=("$@")
|
|
|
|
while [[ $# -gt 0 ]]; do case $1 in
|
|
|
|
--interface)
|
|
|
|
iface=$2
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
esac; shift; done
|
2019-07-12 11:08:41 +02:00
|
|
|
|
2020-05-18 23:57:29 +02:00
|
|
|
# Create tun device if necessary
|
|
|
|
if [ ! -e /dev/net/tun ]; then
|
|
|
|
mkdir -p /dev/net
|
|
|
|
mknod /dev/net/tun c 10 200
|
|
|
|
fi
|
2019-07-12 11:08:41 +02:00
|
|
|
|
2020-05-18 23:57:29 +02:00
|
|
|
wireguard-go ${iface:-wgoverlay}
|
|
|
|
/app/wesher --log-level debug --cluster-key 'ILICZ3yBMCGAWNIq5Pn0bewBVimW3Q2yRVJ/Be+b1Uc=' "${args[@]}"
|