mirror of
https://github.com/pcvolkmer/docker-wireguard-boringtun.git
synced 2025-04-19 13:26:50 +00:00
27 lines
366 B
Bash
Executable File
27 lines
366 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
if [ -z $DEVICE ]; then
|
|
DEVICE="tun0"
|
|
fi
|
|
|
|
if [ ! -f "/etc/wireguard/$DEVICE.conf" ]; then
|
|
cd /etc/wireguard
|
|
/create-config.sh
|
|
exit 0
|
|
fi
|
|
|
|
if [ "add-client" == "$1" ]; then
|
|
cd /etc/wireguard
|
|
/add-client.sh
|
|
exit 0
|
|
fi
|
|
|
|
echo "Starting wg-quick on $DEVICE"
|
|
touch "${WG_LOG_FILE}"
|
|
wg-quick up $DEVICE
|
|
echo "done!"
|
|
|
|
tail -f "${WG_LOG_FILE}"
|