Update setup.sh
This commit is contained in:
@@ -327,51 +327,6 @@ start_game_services() {
|
||||
done
|
||||
fi
|
||||
|
||||
# If service is firegex, add and start each port using Firegex API
|
||||
if [ "$service_name" = "firegex" ]; then
|
||||
FIREGEX_API="http://5.129.246.129:4444/api/nfregex/services"
|
||||
FIREGEX_TOKEN="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dnZWRfaW4iOnRydWV9.67yI3kSfR2KvzmxmY-jwMA58Njeb0bJAgVOMg54YZXE"
|
||||
FIREGEX_COOKIE="JSESSIONID=44D35DA9395B6A4EF09F6D8B27B06BD6; session=eyJsb2dnZWRfaW4iOnRydWV9.aS8Y2Q.eOgREAZvWC2mc_9TnNDzd8mAa9A"
|
||||
FIREGEX_IP="5.129.246.129"
|
||||
for port in $(echo "$service_ports" | tr ',' ' '); do
|
||||
# Add port to Firegex
|
||||
add_response=$(curl -s "$FIREGEX_API" \
|
||||
-H "Accept: */*" \
|
||||
-H "Accept-Language: ru,en;q=0.9,en-GB;q=0.8,en-US;q=0.7" \
|
||||
-H "Authorization: Bearer $FIREGEX_TOKEN" \
|
||||
-H "Cache-Control: max-age=0" \
|
||||
-H "Content-Type: application/json" \
|
||||
-b "$FIREGEX_COOKIE" \
|
||||
-H "Origin: http://$FIREGEX_IP:4444" \
|
||||
-H "Proxy-Connection: keep-alive" \
|
||||
-H "Referer: http://$FIREGEX_IP:4444/nfregex" \
|
||||
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0" \
|
||||
--data-raw "{\"name\":\"$service_name\",\"port\":$port,\"proto\":\"tcp\",\"ip_int\":\"$FIREGEX_IP\",\"fail_open\":false}" \
|
||||
--insecure)
|
||||
service_id=$(echo "$add_response" | grep -oE '"id":"[^"]+"' | sed 's/"id":"//;s/"//')
|
||||
echo "Firegex add response: $add_response"
|
||||
if [ -n "$service_id" ]; then
|
||||
# Start service in Firegex
|
||||
start_response=$(curl -s "$FIREGEX_API/$service_id/start" \
|
||||
-X "POST" \
|
||||
-H "Accept: */*" \
|
||||
-H "Accept-Language: ru,en;q=0.9,en-GB;q=0.8,en-US;q=0.7" \
|
||||
-H "Authorization: Bearer $FIREGEX_TOKEN" \
|
||||
-H "Cache-Control: max-age=0" \
|
||||
-H "Content-Length: 0" \
|
||||
-b "$FIREGEX_COOKIE" \
|
||||
-H "Origin: http://$FIREGEX_IP:4444" \
|
||||
-H "Proxy-Connection: keep-alive" \
|
||||
-H "Referer: http://$FIREGEX_IP:4444/nfregex" \
|
||||
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0" \
|
||||
--insecure)
|
||||
echo "Firegex start response: $start_response"
|
||||
else
|
||||
echo "Could not parse Firegex service ID for port $port."
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
service_count=$((service_count + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user