diff --git a/run_node.sh b/run_node.sh index fa38796..b608f21 100755 --- a/run_node.sh +++ b/run_node.sh @@ -17,5 +17,12 @@ pkill pulseaudio # Ensure BT stack is here python3 -u $SCRIPT_DIR/src/bt_preconnect.py $SCRIPT_DIR/config/agent.yaml -# Run main script -python3 -u $SCRIPT_DIR/src/agent_gsm.py --config $SCRIPT_DIR/config/agent.yaml +#!/bin/bash +if [ -n "$1" ] +then + # Run main script + python3 -u $SCRIPT_DIR/src/agent_gsm.py --config $SCRIPT_DIR/config/agent.yaml "$1" +else + python3 -u $SCRIPT_DIR/src/agent_gsm.py --config $SCRIPT_DIR/config/agent.yaml + +fi diff --git a/src/agent_gsm.py b/src/agent_gsm.py index 8a653f1..152894e 100644 --- a/src/agent_gsm.py +++ b/src/agent_gsm.py @@ -311,7 +311,7 @@ def run_caller_task(t): # Runs caller probe - load task list and perform calls def run_probe(): - global TASK_LIST, REFERENCE_AUDIO, LOADED_AUDIO, CURRENT_TASK + global TASK_LIST, REFERENCE_AUDIO, LOADED_AUDIO, CURRENT_TASK, FORCE_RUN while True: # Get task list update @@ -403,6 +403,9 @@ if len(sys.argv) < 2: parser.print_help() sys.exit(EXIT_OK) +if args.test: + FORCE_RUN = True + if Path(QUALTEST_PID).exists() and args.check_pid_file: print(f'File {QUALTEST_PID} exists, seems another instance of script is running. Please delete {QUALTEST_PID} to allow the start.') sys.exit(EXIT_OK)