Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2024-01-10 06:09:25 +03:00
parent 15bad014b4
commit 96c6b07fe7
3 changed files with 6 additions and 3 deletions

View File

@ -41,6 +41,8 @@ xread "Wireguard endpoint: " ENDPOINT
DFL_ENDPOINT_PORT=${DFL_ENDPOINT_PORT:=51820}
xread "Wireguard endpoint port: " ENDPOINT_PORT
CLIENT_IPS=10.42.1.0/16
readVars
@ -73,7 +75,7 @@ OPTS_STAGE_2="\
#----------------------------------------------------------------------
echo "# Building config..."
buildAssets ENDPOINT ENDPOINT_PORT DNS
buildAssets ENDPOINT ENDPOINT_PORT DNS CLIENT_IPS
echo "# Creating CT..."
pctCreateAlpine $ID "${OPTS_STAGE_1}" "$PASS"
@ -83,6 +85,7 @@ echo "# Installing dependencies..."
echo "# Copying assets..."
@ pct-push-r $ID ./assets /
@ lxc-attach $ID -- chmod +x /root/getFreeClientIP
#echo "# Setup: wireguard server..."
@ lxc-attach $ID -- bash -c 'cd /root && make server'

View File

@ -11,7 +11,7 @@ SERVER_PUBLIC_KEY := $(SERVER_DIR)/server_id.pub
CLIENT_TPL := templates/client.conf
CLIENT_DIR := $(SERVER_DIR)/clients/
CLIENT_IPS ?= 10.42.0.0/16
CLIENT_IPS ?= ${CLIENT_IPS}
ENDPOINT_PORT ?= ${ENDPOINT_PORT}
ENDPOINT ?= ${ENDPOINT}

View File

@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
CLIENT_IPS=${CLIENT_IPS}