|
@ -53,6 +53,13 @@ wg_register () { |
|
|
|
|
|
|
|
|
gw_key=$(uci get wgserver.@server[0].wg_key) |
|
|
gw_key=$(uci get wgserver.@server[0].wg_key) |
|
|
gw_pub=$(uci get wgserver.@server[0].wg_pub) |
|
|
gw_pub=$(uci get wgserver.@server[0].wg_pub) |
|
|
|
|
|
|
|
|
|
|
|
if [ $(uci get wgserver.@server[0].wg_tmp_key) -eq 1]; then |
|
|
|
|
|
[ -d "/tmp/run/wgserver" ] || mkdir -p /tmp/run/wgserver |
|
|
|
|
|
gw_key="/tmp/run/wgserver/${ifname}.key" |
|
|
|
|
|
gw_pub="/tmp/run/wgserver/${ifname}.pub" |
|
|
|
|
|
wg genkey | tee $gw_key | wg pubkey > $gw_pub |
|
|
|
|
|
fi |
|
|
wg_server_pubkey=$(cat $gw_pub) |
|
|
wg_server_pubkey=$(cat $gw_pub) |
|
|
|
|
|
|
|
|
# create wg tunnel |
|
|
# create wg tunnel |
|
|