Loading src/main/java/database/update_points.shdeleted 100755 → 0 +0 −35 Original line number Diff line number Diff line #!/bin/bash # Endpoint URL for updating points URL="http://localhost:8080/pointset/set123" # Initialize random seed once RANDOM_SEED=$(date +%s) # Loop indefinitely to update points while true; do # Generate random points x1=$(awk -v min=0 -v max=10 -v seed=$RANDOM_SEED 'BEGIN{srand(seed); print min+rand()*(max-min)}') y1=$(awk -v min=0 -v max=10 -v seed=$RANDOM_SEED 'BEGIN{srand(seed + 1); print min+rand()*(max-min)}') z1=$(awk -v min=0 -v max=10 -v seed=$RANDOM_SEED 'BEGIN{srand(seed + 2); print min+rand()*(max-min)}') x2=$(awk -v min=0 -v max=10 -v seed=$RANDOM_SEED 'BEGIN{srand(seed + 3); print min+rand()*(max-min)}') y2=$(awk -v min=0 -v max=10 -v seed=$RANDOM_SEED 'BEGIN{srand(seed + 4); print min+rand()*(max-min)}') z2=$(awk -v min=0 -v max=10 -v seed=$RANDOM_SEED 'BEGIN{srand(seed + 5); print min+rand()*(max-min)}') # Create JSON payload JSON_PAYLOAD="{\"points\":[{\"x\":$x1,\"y\":$y1,\"z\":$z1},{\"x\":$x2,\"y\":$y2,\"z\":$z2}]}" # Send POST request to update the point set response=$(curl -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -d "$JSON_PAYLOAD" $URL) # Check if the POST was successful if [[ "$response" -ne 200 ]] ; then echo "Failed to update points, server responded with status: $response" break # or handle error differently fi # Wait for a bit before the next update sleep 5 done Loading
src/main/java/database/update_points.shdeleted 100755 → 0 +0 −35 Original line number Diff line number Diff line #!/bin/bash # Endpoint URL for updating points URL="http://localhost:8080/pointset/set123" # Initialize random seed once RANDOM_SEED=$(date +%s) # Loop indefinitely to update points while true; do # Generate random points x1=$(awk -v min=0 -v max=10 -v seed=$RANDOM_SEED 'BEGIN{srand(seed); print min+rand()*(max-min)}') y1=$(awk -v min=0 -v max=10 -v seed=$RANDOM_SEED 'BEGIN{srand(seed + 1); print min+rand()*(max-min)}') z1=$(awk -v min=0 -v max=10 -v seed=$RANDOM_SEED 'BEGIN{srand(seed + 2); print min+rand()*(max-min)}') x2=$(awk -v min=0 -v max=10 -v seed=$RANDOM_SEED 'BEGIN{srand(seed + 3); print min+rand()*(max-min)}') y2=$(awk -v min=0 -v max=10 -v seed=$RANDOM_SEED 'BEGIN{srand(seed + 4); print min+rand()*(max-min)}') z2=$(awk -v min=0 -v max=10 -v seed=$RANDOM_SEED 'BEGIN{srand(seed + 5); print min+rand()*(max-min)}') # Create JSON payload JSON_PAYLOAD="{\"points\":[{\"x\":$x1,\"y\":$y1,\"z\":$z1},{\"x\":$x2,\"y\":$y2,\"z\":$z2}]}" # Send POST request to update the point set response=$(curl -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" -d "$JSON_PAYLOAD" $URL) # Check if the POST was successful if [[ "$response" -ne 200 ]] ; then echo "Failed to update points, server responded with status: $response" break # or handle error differently fi # Wait for a bit before the next update sleep 5 done