From 5114fcfdb089a909c8bf6670306caa1aa618e320 Mon Sep 17 00:00:00 2001 From: ilyastar9999 Date: Tue, 2 Dec 2025 18:33:05 +0300 Subject: [PATCH] Update setup.sh --- setuper/setup.sh | 45 ++++++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/setuper/setup.sh b/setuper/setup.sh index 88b8c7f..e0a705d 100644 --- a/setuper/setup.sh +++ b/setuper/setup.sh @@ -62,20 +62,31 @@ setup_packmate() { cd "$packmate_dir" fi mkdir -p pcaps rsa_keys Packmate_stuff + # Read config from parent .env + BOARD_URL=$(grep '^BOARD_URL=' "$ENV_FILE" | cut -d'=' -f2- | tr -d '"' | xargs) + PACKMATE_LOCAL_IP=$(grep '^PACKMATE_LOCAL_IP=' "$ENV_FILE" | cut -d'=' -f2- | tr -d '"' | xargs) + NET_INTERFACE=$(grep '^NET_INTERFACE=' "$ENV_FILE" | cut -d'=' -f2- | tr -d '"' | xargs) + # Defaults if not set + if [ -z "$PACKMATE_LOCAL_IP" ]; then + PACKMATE_LOCAL_IP="10.60.1.2" + fi + if [ -z "$NET_INTERFACE" ]; then + NET_INTERFACE="eth0" + fi # .env and config generation (minimal) - cat > .env <<'ENVEOF' + cat > .env < .env <<'ENVEOF' + # Read config from parent .env + BOARD_URL=$(grep '^BOARD_URL=' "$ENV_FILE" | cut -d'=' -f2- | tr -d '"' | xargs) + TEAM_TOKEN=$(grep '^TEAM_TOKEN=' "$ENV_FILE" | cut -d'=' -f2- | tr -d '"' | xargs) + NUM_TEAMS=$(grep '^NUM_TEAMS=' "$ENV_FILE" | cut -d'=' -f2- | tr -d '"' | xargs) + IP_TEAM_BASE=$(grep '^IP_TEAM_BASE=' "$ENV_FILE" | cut -d'=' -f2- | tr -d '"' | xargs) + cat > .env < .env <<'ENVEOF' -TEAM_TOKEN=your-team-token -SCOREBOARD_URL=http://10.60.0.1 + # Read config from parent .env + BOARD_URL=$(grep '^BOARD_URL=' "$ENV_FILE" | cut -d'=' -f2- | tr -d '"' | xargs) + TEAM_TOKEN=$(grep '^TEAM_TOKEN=' "$ENV_FILE" | cut -d'=' -f2- | tr -d '"' | xargs) + cat > .env <