Last active
November 20, 2019 23:50
-
-
Save JonBons/815a64c1a8fd9a4765e42a76f9e57189 to your computer and use it in GitHub Desktop.
Yi 4K loop recording cleanup/auto-record
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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