Skip to content

Instantly share code, notes, and snippets.

@JonBons JonBons/bootcmd.sh
Last active Nov 20, 2019

Embed
What would you like to do?
Yi 4K loop recording cleanup/auto-record
#!/bin/sh
cd /tmp/fuse_d/DCIM
storage_space=$(df -k . | tr -s ' ' | cut -d" " -f 5 | tail -n 1 | sed 's/[^0-9]*//g')
latest_dcim=$(ls | tail -1)
cd $latest_dcim
if [ $storage_space -gt 90 ]
then
rm "$(ls -t | tail -1)"
rm "$(ls -t | tail -1)"
/tmp/fuse_d/bootcmd.sh
exit 0
else
/usr/bin/SendToRTOS record
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.