mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-10-29 19:20:10 +00:00
tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
37037a3a43
commit
36689166d5
@ -57,6 +57,7 @@ DNS=${DNS/\/*}
|
|||||||
xread "Local network DNS:" DNS
|
xread "Local network DNS:" DNS
|
||||||
|
|
||||||
xreadYes "Show profile as QRcode when done?" QRCODE
|
xreadYes "Show profile as QRcode when done?" QRCODE
|
||||||
|
QRCODE=${QRCODE:-0}
|
||||||
|
|
||||||
readVars
|
readVars
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
|
INTERFACE := wg0
|
||||||
|
|
||||||
SERVER_DIR := /etc/wireguard/
|
SERVER_DIR := /etc/wireguard/
|
||||||
SERVER_TPL := templates/wg0.conf
|
SERVER_TPL := templates/server.conf
|
||||||
SERVER_CLIENT_TPL := templates/wg0-client.tpl
|
SERVER_CLIENT_TPL := templates/client.tpl
|
||||||
SERVER_CONF := $(SERVER_DIR)/wg0.conf
|
SERVER_CONF := $(SERVER_DIR)/$(INTERFACE).conf
|
||||||
SERVER_KEY := $(SERVER_DIR)/server_id
|
SERVER_KEY := $(SERVER_DIR)/server_id
|
||||||
SERVER_PUBLIC_KEY := $(SERVER_DIR)/server_id.pub
|
SERVER_PUBLIC_KEY := $(SERVER_DIR)/server_id.pub
|
||||||
|
|
||||||
@ -64,8 +64,9 @@ $(SERVER_CONF): $(SERVER_TPL) $(SERVER_KEY)
|
|||||||
-e 's/\$${\CLIENT_PUBLIC_KEY}/'$$(sed -e 's/\//\\\//g' "$(CLIENT_DIR)/$*_id.pub")'/g' \
|
-e 's/\$${\CLIENT_PUBLIC_KEY}/'$$(sed -e 's/\//\\\//g' "$(CLIENT_DIR)/$*_id.pub")'/g' \
|
||||||
-e 's/\$${\SERVER_PUBLIC_KEY}/'$$(sed -e 's/\//\\\//g' "$(SERVER_PUBLIC_KEY)")'/g' \
|
-e 's/\$${\SERVER_PUBLIC_KEY}/'$$(sed -e 's/\//\\\//g' "$(SERVER_PUBLIC_KEY)")'/g' \
|
||||||
>> "$(SERVER_CONF)"
|
>> "$(SERVER_CONF)"
|
||||||
@ [ -z "$$QRCODE" ] \
|
make update
|
||||||
|| ( echo "# Profile: $*" \
|
@ [ "$(QRCODE)" == "1" ] \
|
||||||
|
&& ( echo "# Profile: $*" \
|
||||||
&& qrencode -t UTF8 -r "$(CLIENT_DIR)/$*.conf" )
|
&& qrencode -t UTF8 -r "$(CLIENT_DIR)/$*.conf" )
|
||||||
|
|
||||||
|
|
||||||
@ -78,4 +79,8 @@ $(SERVER_CONF): $(SERVER_TPL) $(SERVER_KEY)
|
|||||||
server: $(SERVER_CONF)
|
server: $(SERVER_CONF)
|
||||||
|
|
||||||
|
|
||||||
|
update:
|
||||||
|
wg syncconf $(INTERFACE) <(wg-quick strip $(INTERFACE))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user