paranoia-1.0/listen.sh
2025-03-04 17:35:54 +01:00

11 lines
219 B
Bash

#!/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