diff --git a/run_node.sh b/run_node.sh index 71f88c3..2db82e6 100755 --- a/run_node.sh +++ b/run_node.sh @@ -12,8 +12,11 @@ export DBUS_SESSION_BUS_ADDRESS # export DBUS_SESSION_BUS_PID # To avoid problems with pulseaudio +python3 -u $SCRIPT_DIR/src/agent_kill.py + pkill pulseaudio + # Ensure BT stack is here # python3 -u $SCRIPT_DIR/src/bt_preconnect.py $SCRIPT_DIR/config/agent.yaml diff --git a/src/agent_kill.py b/src/agent_kill.py new file mode 100644 index 0000000..fdc2f15 --- /dev/null +++ b/src/agent_kill.py @@ -0,0 +1,14 @@ +#!/usr/bin/python3 + +import agent_config +import os + +if __name__ == '__main__': + config = agent_config.AgentConfig() + if config.QualtestPID: + if config.QualtestPID.exists(): + with open(config.QualtestPID, 'rt') as f: + pid = f.read().strip() + os.system(f'pkill {pid}') + +