Files
clearpilot/system/clearpilot/shell_archived/watcher_run_loop.sh
Comma Device 1ff14d346f wip
2024-05-14 08:21:27 +00:00

21 lines
401 B
Bash
Executable File

cd /data/openpilot/shell
while true
do
nodejs watcher.js
# Get free space on /data in GB
free_space=$(df -BG /data | tail -n 1 | awk '{print $4}' | sed 's/G//')
# Check if free space is less than 10GB
if [ "$free_space" -lt 10 ]; then
echo "Less than 10GB of free space on /data. Exiting."
exit 1
fi
echo crashed, waiting 30 seconds
sleep 30
done