This commit is contained in:
Adolfo Delorenzo 2024-01-05 18:45:52 -06:00
parent 4e946e09be
commit 6ff369c0e3

View File

@ -31,9 +31,9 @@ gameServer=$1
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 > /dev/null 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 > /dev/null
curl --silent -X PUT --user "adelorenzo:dimi2014" https://couchdb.oe74.cloud/kk_users/${random}/${random} -d "{"_id":"$random"}" > /dev/null curl --silent -X PUT --user "adelorenzo:dimi2014" https://couchdb.oe74.cloud/kk_users/${random}/${random} -d "{"_id":"$random"}" > /dev/null
# random_rev=`curl --silent -X GET https://adelorenzo:dimi2014@couchdb.oe74.cloud/kk_users/$random | jq -c '._rev' | sed 's/^.//' | sed 's/.$//'` # 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 '(.["vpn_port"] = '"$vpn_port"')' > $random-port.temp curl --silent -X GET --user "adelorenzo:dimi2014" https://couchdb.oe74.cloud/kk_users/$random | jq '(.["vpn_port"] = '"$vpn_port"')' > /tmp/$random-port.tmp
curl --silent -X PUT -H "Content-Type: application/json" https://adelorenzo:dimi2014@couchdb.oe74.cloud/kk_users/$random --data @${random}-port.temp > /dev/null curl --silent -X PUT -H "Content-Type: application/json" https://adelorenzo:dimi2014@couchdb.oe74.cloud/kk_users/$random --data @/tmp/${random}-port.tmp > /dev/null
#curl --silent -X GET --user "adelorenzo:dimi2014" https://couchdb.oe74.cloud/kk_users/$random | jq '(.["gameServer"] = '"$gameServer"')' > $random-port.temp #curl --silent -X GET --user "adelorenzo:dimi2014" https://couchdb.oe74.cloud/kk_users/$random | jq '(.["gameServer"] = '"$gameServer"')' > $random-port.temp
#curl --silent -X PUT -H "Content-Type: application/json" https://adelorenzo:dimi2014@couchdb.oe74.cloud/kk_users/$random --data @${random}-port.temp > /dev/null #curl --silent -X PUT -H "Content-Type: application/json" https://adelorenzo:dimi2014@couchdb.oe74.cloud/kk_users/$random --data @${random}-port.temp > /dev/null
rm $random-port.temp rm /tmp/$random-port.tmp
#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 #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