From c1fbfc44c6b865123be3765e3327bd867916c9da Mon Sep 17 00:00:00 2001 From: Arkady23 Date: Wed, 21 Apr 2021 12:03:27 +1000 Subject: [PATCH] Add files via upload --- yi-hack-v3+/yi-hack-v3/app/_init.sh | 7 ++++++- yi-hack-v3+/yi-hack-v3/script/system.sh | 11 ++++------- yi-hack-v3+/yi-hack-v3/www/cgi-bin/poweroff.sh | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/yi-hack-v3+/yi-hack-v3/app/_init.sh b/yi-hack-v3+/yi-hack-v3/app/_init.sh index 7080cff..438ac1a 100644 --- a/yi-hack-v3+/yi-hack-v3/app/_init.sh +++ b/yi-hack-v3+/yi-hack-v3/app/_init.sh @@ -23,12 +23,12 @@ log(){ echo "$time $@" >> $LOGFILE } + if [ -f "$LOGFILE" ]; then L=1 N=$(ls -l $LOGFILE | awk '{ print $5 }') if [ $N -le 10000 ]; then exec 2>> $LOGFILE - log "Starting init.sh" else rm -f $LOGFILE fi @@ -36,6 +36,11 @@ else L=0 fi +$YI_HACK_PREFIX/yi-hack-v3/script/clean_records.sh 2 +if [ $L == 1 ] ; then + log "Starting init.sh" +fi + RTSP=$(get_config RTSP) L1=no diff --git a/yi-hack-v3+/yi-hack-v3/script/system.sh b/yi-hack-v3+/yi-hack-v3/script/system.sh index e56173c..ec15502 100644 --- a/yi-hack-v3+/yi-hack-v3/script/system.sh +++ b/yi-hack-v3+/yi-hack-v3/script/system.sh @@ -62,21 +62,18 @@ fi if [ -f "$sd/yi-hack-v3/startup.sh" ]; then $sd/yi-hack-v3/startup.sh fi -if [ -f "$sd/etc/wpa_supplicant.conf" ]; then - cp -f $sd/etc/wpa_supplicant.conf /tmp/ -fi if [[ $(get_config DISABLE_CLOUD) == "yes" ]]; then sleep 20 if [[ $(get_config REC_WITHOUT_CLOUD) == "yes" ]]; then crond -c $YI_HACK_V3_PREFIX/etc/crontabs - i=0 - while [ $i -lt 50 ]; do + N=0 + while [ $N -lt 60 ]; do if [ -f "$sd/record/tmp.mp4.tmp" ]; then - i=50 + N=60 fi sleep 8 - i=$(( $i + 1 )) + N=$(($N+1)) done killall cloudAPI killall cloud diff --git a/yi-hack-v3+/yi-hack-v3/www/cgi-bin/poweroff.sh b/yi-hack-v3+/yi-hack-v3/www/cgi-bin/poweroff.sh index 2f5dce5..c01ef72 100644 --- a/yi-hack-v3+/yi-hack-v3/www/cgi-bin/poweroff.sh +++ b/yi-hack-v3+/yi-hack-v3/www/cgi-bin/poweroff.sh @@ -3,7 +3,7 @@ /home/app/script/killapp.sh killall5 sync -umount -lr /tmp/sd +umount -lr /dev/mmcblk0p1 if [ "$QUERY_STRING" ]; then reboot