From f34df4ba6b8215912ed3c0cbfae71cf3e443f69d Mon Sep 17 00:00:00 2001 From: Adolfo Delorenzo Date: Wed, 3 Jan 2024 18:32:26 -0600 Subject: [PATCH] added vpn_port --- gen_random.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gen_random.sh b/gen_random.sh index 645e92b..1d7286b 100755 --- a/gen_random.sh +++ b/gen_random.sh @@ -29,6 +29,6 @@ vpn_port=`python3 /opt/thekube/ports.py` lxc config device add $random-vpn-server udp$vpn_port proxy listen=udp:0.0.0.0:$vpn_port connect=udp:127.0.0.1:51820 curl --silent -X PUT --user "adelorenzo:dimi2014" https://couchdb.oe74.cloud/kk_users/${random}/${random} -d "{"_id":"$random"}" random_rev=`curl --silent -X GET https://adelorenzo:dimi2014@couchdb.oe74.cloud/kk_users/$random | jq -c '._rev' | sed 's/^.//' | sed 's/.$//'` -curl --silent -X GET --user "adelorenzo:dimi2014" https://couchdb.oe74.cloud/kk_users/$random | jq '(.["port"] = '"$vpn_port"')' > $random-port.temp -#curl -X PUT -H "Content-Type: application/json" https://adelorenzo:dimi2014@couchdb.oe74.cloud/kk_users/$random --data @${random}-port.temp +curl --silent -X GET --user "adelorenzo:dimi2014" https://couchdb.oe74.cloud/kk_users/$random | jq '(.["vpn_port"] = '"$vpn_port"')' > $random-port.temp +curl -X PUT -H "Content-Type: application/json" https://adelorenzo:dimi2014@couchdb.oe74.cloud/kk_users/$random --data @${random}-port.temp #curl --silent -H "Content-Type: text/x-yaml" -X PUT --data-binary @${random}-wg_server.yaml --user "adelorenzo:dimi2014" "https://couchdb.oe74.cloud/kk_users/${random}/${random}-wg_server.yaml?rev=$random_rev" > /dev/null