From 9240ce974a3922fb928ac0a2a40855cbd6038bf3 Mon Sep 17 00:00:00 2001 From: Daniel Markstedt Date: Tue, 26 Oct 2021 18:21:39 -0700 Subject: [PATCH] Pkill other oled monitor scripts before starting new one --- src/oled_monitor/start.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/oled_monitor/start.sh b/src/oled_monitor/start.sh index a51553a5..e48b63df 100755 --- a/src/oled_monitor/start.sh +++ b/src/oled_monitor/start.sh @@ -47,6 +47,12 @@ if [ $ERROR = 1 ] ; then exit 1 fi +if pgrep -f "python3 rascsi_oled_monitor.py" &> /dev/null; then + echo "Detected active rascsi_oled_monitor.py process" + echo "Terminating before launching a new one." + sudo pkill -f "python3 rascsi_oled_monitor.py" +fi + if ! i2cdetect -y 1 &> /dev/null ; then echo "i2cdetect -y 1 did not find a screen." exit 2