agent_gsm/debug_node.sh

29 lines
865 B
Bash
Executable File

#!/bin/bash
# Oneliner to find script's directory. Please note - last path component should NOT be symlink.
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )";
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
# DBUS_SESSION_BUS_PID=`cat /run/dbus/pid`
export DBUS_SESSION_BUS_ADDRESS
# export DBUS_SESSION_BUS_PID
# To avoid problems with pulseaudio
pkill pulseaudio
while true; do
read -p "Do you wish to enable bad network simulation for gsm.sevana.biz ? " yn
case $yn in
[Yy]* ) $SCRIPT_DIR/start_bad_network.sh; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
# Ensure BT stack is here
python3 -u $SCRIPT_DIR/src/bt_preconnect.py $SCRIPT_DIR/config/agent.yaml
python3 -u $SCRIPT_DIR/src/agent_gsm.py --config $SCRIPT_DIR/config/agent.yaml --test