Move scripts into dedicated directory

This commit is contained in:
2022-11-29 07:22:58 +01:00
parent f3dbcf0515
commit e9e9839e64
4 changed files with 6 additions and 4 deletions

26
scripts/entrypoint.sh Executable file
View File

@ -0,0 +1,26 @@
#!/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}"