#10 Update actions and setup script
- 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:
@@ -23,4 +23,4 @@ jobs:
|
|||||||
- name: Test setup script
|
- name: Test setup script
|
||||||
working-directory: "./client"
|
working-directory: "./client"
|
||||||
run: |
|
run: |
|
||||||
sudo bash setup.sh
|
sudo bash setup.sh --test
|
||||||
@@ -75,8 +75,4 @@ jobs:
|
|||||||
working-directory: "./client"
|
working-directory: "./client"
|
||||||
run: npm test
|
run: npm test
|
||||||
|
|
||||||
- run: echo "Completed the NPM tests"
|
- run: echo "Completed the DRB tests"
|
||||||
|
|
||||||
- name: Start discord-radio-bot service
|
|
||||||
working-directory: "./client"
|
|
||||||
run: systemctl start discord-radio-bot.service
|
|
||||||
@@ -19,43 +19,67 @@ fi
|
|||||||
####------------------- Functions
|
####------------------- Functions
|
||||||
# Function to prompt user for input with a specific message and store the result in a variable
|
# Function to prompt user for input with a specific message and store the result in a variable
|
||||||
prompt_user() {
|
prompt_user() {
|
||||||
read -p "$1: " input
|
if [[ "$TEST_MODE" == "true" ]]; then
|
||||||
echo "$input"
|
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
|
# Function to prompt user for capabilities options and store the result in a variable
|
||||||
prompt_capabilities() {
|
prompt_capabilities() {
|
||||||
default_capabilities="radio" # Default value
|
if [[ "$TEST_MODE" == "true" ]]; then
|
||||||
read -p "Select CLIENT_CAPABILITIES (comma-separated, default: $default_capabilities): " capabilities
|
echo "radio" # Use the pre-set value
|
||||||
capabilities="${capabilities:-$default_capabilities}" # Use default value if input is empty
|
else
|
||||||
echo "$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"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to prompt user for nearby systems details
|
# Function to prompt user for nearby systems details
|
||||||
prompt_nearby_system() {
|
prompt_nearby_system() {
|
||||||
local system_name=""
|
if [[ "$TEST_MODE" == "true" ]]; then
|
||||||
local frequencies=""
|
echo "\"TESTING-Node\": {
|
||||||
local mode=""
|
\"frequencies\": [\"$(echo "155750000,154750000,156555550" | sed 's/,/","/g')\"],
|
||||||
local trunk_file=""
|
\"mode\": \"p25\",
|
||||||
local whitelist_file=""
|
\"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 system name: " system_name
|
||||||
read -p "Enter frequencies (comma-separated): " frequencies
|
read -p "Enter frequencies (comma-separated): " frequencies
|
||||||
read -p "Enter mode (p25/nbfm): " mode
|
read -p "Enter mode (p25/nbfm): " mode
|
||||||
|
|
||||||
if [[ "$mode" == "p25" ]]; then
|
if [[ "$mode" == "p25" ]]; then
|
||||||
read -p "Enter trunk file: " trunk_file
|
read -p "Enter trunk file: " trunk_file
|
||||||
read -p "Enter whitelist file: " whitelist_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
|
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
|
# Install Node Repo
|
||||||
# Get the CPU architecture
|
# Get the CPU architecture
|
||||||
cpu_arch=$(uname -m)
|
cpu_arch=$(uname -m)
|
||||||
|
|||||||
Reference in New Issue
Block a user