feat: listen and exec ommands from the serial

This commit is contained in:
DinoMalin
2025-03-04 17:35:54 +01:00
parent 5a4bec3b02
commit d80a374615
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
while read -r line; do
line=$(echo "$line" | grep "\[CMD\]")
if [[ "$line" != "" ]]; then
cmd=$(echo $line | sed 's/\[[^]]*\]//' | sed 's/\[//' | sed 's/\]//')
bash -c "$cmd"
fi
done < /dev/ttyACM0