#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
|
||||
working-directory: "./client"
|
||||
run: |
|
||||
sudo bash setup.sh
|
||||
sudo bash setup.sh --test
|
||||
@@ -75,8 +75,4 @@ jobs:
|
||||
working-directory: "./client"
|
||||
run: npm test
|
||||
|
||||
- run: echo "Completed the NPM tests"
|
||||
|
||||
- name: Start discord-radio-bot service
|
||||
working-directory: "./client"
|
||||
run: systemctl start discord-radio-bot.service
|
||||
- run: echo "Completed the DRB tests"
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user