2024-04-01 20:34:32 +08:00

35 lines
1.0 KiB
Bash

#!/usr/bin/env bash
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
OPENIM_SCRIPTS=$(dirname "${BASH_SOURCE[0]}")/
source "$OPENIM_SCRIPTS/lib/path.sh"
source "$OPENIM_SCRIPTS/define/binaries.sh"
# Assuming 'openim::util::host_platform' is defined in one of the sourced scripts or elsewhere.
# If not, you'll need to define it to return the appropriate platform directory name.
# Main function to start binaries
start_binaries() {
local project_dir="$OPENIM_ROOT" # You should adjust this path as necessary
echo $OPENIM_ROOT 12322222222222222222222222222222
# Iterate over binaries defined in binary_path.sh
for binary in "${!binaries[@]}"; do
local count=${binaries[$binary]}
local bin_full_path=$(get_bin_full_path "$binary")
# Loop to start binary the specified number of times
for ((i=0; i<count; i++)); do
echo "Starting $binary instance $i: $bin_full_path -i $i -c $OPENIM_OUTPUT_CONFIG"
"$bin_full_path" -i "$i" -c "$conf_dir"
done
done
}
# Call the main function
start_binaries