forked from geezacoleman/OpenWeedLocator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfocus_owl.sh
More file actions
26 lines (20 loc) · 735 Bytes
/
Copy pathfocus_owl.sh
File metadata and controls
26 lines (20 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# Check if owl.py or greenonbrown.py is running
if pgrep -f "owl.py" >/dev/null; then
program_name="owl.py"
elif pgrep -f "greenonbrown.py" >/dev/null; then
program_name="greenonbrown.py"
fi
if [[ -n $program_name ]]; then
echo "[INFO] '$program_name' is running and needs to be stopped before continuing with focusing."
# Get PID of owl.py or greenonbrown.py
pid=$(pgrep -f "$program_name")
# Kill the process using sudo
sudo kill "$pid"
echo "[INFO] '$program_name' (PID: $pid) has been stopped. Continuing with focusing..."
else
echo "[INFO] Neither owl.py nor greenonbrown.py were found to be running. Continuing with focusing..."
fi
# Launch owl.py with focusing flag
cd ~/owl
./owl.py --focus