tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2024-01-09 14:31:04 +03:00
parent 52c11ba2b2
commit 788d2f199f

View File

@ -28,9 +28,9 @@ DNS := 10.1.1.1
$(SERVER_CONF): $(SERVER_TPL) $(SERVER_KEY)
cat $< \
| sed \
-e 's/$${SERVER_PORT}/$(SERVER_PORT)/g' \
-e 's/$${CLIENT_IPS}/$(CLIENT_IPS)/g' \
-e 's/$${SERVER_PRIVATE_KEY}/'$$(cat "$(SERVER_KEY)")'/g' \
-e 's/\$${ENDPOINT_PORT}/$(SERVER_PORT)/g' \
-e 's/\$${CLIENT_IPS}/$(subst /,\/,$(CLIENT_IPS))/g' \
-e 's/\$${SERVER_PRIVATE_KEY}/'$$(cat "$(subst /,\/,$(SERVER_KEY))")'/g' \
> "$@"
$(CLIENT_DIR)/%.conf: $(CLIENT_TPL) $(SERVER_CLIENT_TPL) \
@ -39,21 +39,21 @@ $(CLIENT_DIR)/%.conf: $(CLIENT_TPL) $(SERVER_CLIENT_TPL) \
@ mkdir -p $$(dirname $@)
cat "$<" \
| sed \
-e 's/$${DNS}/$(DNS)/g' \
-e 's/$${ENDPOINT}/$(ENDPOINT)/g' \
-e 's/$${ENDPOINT_PORT}/$(ENDPOINT_PORT)/g' \
-e 's/$${ALLOWED_IPS}/$(ALLOWED_IPS)/g' \
-e 's/$${CLIENT_IP}/$(CLIENT_IP)/g' \
-e 's/$${CLIENT_PRIVATE_KEY}/'$$(cat "$(CLIENT_DIR)/$%_id")'/g' \
-e 's/$${SERVER_PUBLIC_KEY}/'$$(cat "$(SERVER_PUBLIC_KEY)")'/g' \
-e 's/\$${DNS}/$(DNS)/g' \
-e 's/\$${ENDPOINT}/$(ENDPOINT)/g' \
-e 's/\$${ENDPOINT_PORT}/$(ENDPOINT_PORT)/g' \
-e 's/\$${ALLOWED_IPS}/$(subst /,\/,$(ALLOWED_IPS))/g' \
-e 's/\$${CLIENT_IP}/$(subst /,\/,$(CLIENT_IP))/g' \
-e 's/\$${CLIENT_PRIVATE_KEY}/'$$(cat "$(subst /,\/,$(CLIENT_DIR))/$%_id")'/g' \
-e 's/\$${SERVER_PUBLIC_KEY}/'$$(cat "$(subst /,\/,$(SERVER_PUBLIC_KEY))")'/g' \
> "$@"
cat "$(SERVER_CLIENT_TPL)" \
| sed \
-e 's/$${CLIENT_IP}/$(CLIENT_IP)/g' \
-e 's/$${ENDPOINT}/$(ENDPOINT)/g' \
-e 's/$${ENDPOINT_PORT}/$(ENDPOINT_PORT)/g' \
-e 's/$${CLIENT_PUBLIC_KEY}/'$$(cat "$(CLIENT_DIR)/$%_id.pub")'/g' \
-e 's/$${SERVER_PUBLIC_KEY}/'$$(cat "$(SERVER_PUBLIC_KEY)")'/g' \
-e 's/\$${CLIENT_IP}/$(subst /,\/,$(CLIENT_IP))/g' \
-e 's/\$${ENDPOINT}/$(ENDPOINT)/g' \
-e 's/\$${ENDPOINT_PORT}/$(ENDPOINT_PORT)/g' \
-e 's/\$${CLIENT_PUBLIC_KEY}/'$$(cat "$(subst /,\/,$(CLIENT_DIR))/$%_id.pub")'/g' \
-e 's/\$${SERVER_PUBLIC_KEY}/'$$(cat "$(subst /,\/,$(SERVER_PUBLIC_KEY))")'/g' \
>> "$(SERVER_CONF)"