#10 Update actions and setup script
Some checks failed
DRB Build Tests / test_setup (push) Failing after 2m5s
DRB Build Tests / drb_build_and_test (push) Successful in 54s

- Removed the step to run the DRB client from socket tests
- Added a testing switch to the install script to return all preset values for all user input
- Added test switch to client setup action step
This commit is contained in:
Logan Cusano
2024-04-21 02:28:37 -04:00
parent 3074e88963
commit 8ba1ed36d8
3 changed files with 50 additions and 30 deletions

View File

@@ -19,43 +19,67 @@ fi
####------------------- Functions
# Function to prompt user for input with a specific message and store the result in a variable
prompt_user() {
read -p "$1: " input
echo "$input"
if [[ "$TEST_MODE" == "true" ]]; then
echo "TESTING" # Use the pre-set value
else
read -p "$1: " input
echo "$input"
fi
}
# Function to prompt user for capabilities options and store the result in a variable
prompt_capabilities() {
default_capabilities="radio" # Default value
read -p "Select CLIENT_CAPABILITIES (comma-separated, default: $default_capabilities): " capabilities
capabilities="${capabilities:-$default_capabilities}" # Use default value if input is empty
echo "$capabilities"
if [[ "$TEST_MODE" == "true" ]]; then
echo "radio" # Use the pre-set value
else
default_capabilities="radio" # Default value
read -p "Select CLIENT_CAPABILITIES (comma-separated, default: $default_capabilities): " capabilities
capabilities="${capabilities:-$default_capabilities}" # Use default value if input is empty
echo "$capabilities"
fi
}
# Function to prompt user for nearby systems details
prompt_nearby_system() {
local system_name=""
local frequencies=""
local mode=""
local trunk_file=""
local whitelist_file=""
if [[ "$TEST_MODE" == "true" ]]; then
echo "\"TESTING-Node\": {
\"frequencies\": [\"$(echo "155750000,154750000,156555550" | sed 's/,/","/g')\"],
\"mode\": \"p25\",
\"trunkFile\": \"testing_trunk.tsv\",
\"whitelistFile\": \"testing_whitelist.tsv\"
}," # Use the pre-set value
else
local system_name=""
local frequencies=""
local mode=""
local trunk_file=""
local whitelist_file=""
read -p "Enter system name: " system_name
read -p "Enter frequencies (comma-separated): " frequencies
read -p "Enter mode (p25/nbfm): " mode
read -p "Enter system name: " system_name
read -p "Enter frequencies (comma-separated): " frequencies
read -p "Enter mode (p25/nbfm): " mode
if [[ "$mode" == "p25" ]]; then
read -p "Enter trunk file: " trunk_file
read -p "Enter whitelist file: " whitelist_file
if [[ "$mode" == "p25" ]]; then
read -p "Enter trunk file: " trunk_file
read -p "Enter whitelist file: " whitelist_file
fi
echo "\"$system_name\": {
\"frequencies\": [\"$(echo "$frequencies" | sed 's/,/","/g')\"],
\"mode\": \"$mode\",
\"trunkFile\": \"$trunk_file\",
\"whitelistFile\": \"$whitelist_file\"
},"
fi
echo "\"$system_name\": {
\"frequencies\": [\"$(echo "$frequencies" | sed 's/,/","/g')\"],
\"mode\": \"$mode\",
\"trunkFile\": \"$trunk_file\",
\"whitelistFile\": \"$whitelist_file\"
},"
}
# Check if test mode is enabled
if [[ "$1" == "--test" ]]; then
TEST_MODE="true"
else
TEST_MODE="false"
fi
# Install Node Repo
# Get the CPU architecture
cpu_arch=$(uname -m)