Skip to content

Commit

Permalink
Fix naming convention for new models
Browse files Browse the repository at this point in the history
  • Loading branch information
roleoroleo committed Aug 10, 2021
1 parent f597e24 commit 6e084f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 5 additions & 1 deletion src/static/static/yi-hack/script/ftppush.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ checkFiles ()
fi
#
echo "${L_FILE_LIST}" | while read file; do
FILE_DATE=${file:15:4}-${file:20:2}-${file:23:2}T${file:26:2}:${file:30:2}
if [ "${#file}" == "14" ]; then
FILE_DATE=${file:15:4}-${file:20:2}-${file:23:2}T${file:26:2}:${file:32:2}
else
FILE_DATE=${file:15:4}-${file:20:2}-${file:23:2}T${file:26:2}:${file:30:2}
fi
FILE_YEAR=${FILE_DATE:0:4}
FILE_REMPART=${FILE_DATE:5:2}${FILE_DATE:8:2}${FILE_DATE:11:2}${FILE_DATE:14:2}
LAST_FILE_SENT=$(cat /tmp/last_file_sent)
Expand Down
9 changes: 2 additions & 7 deletions src/www/httpd/cgi-bin/eventsfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ esac
CONF="$(echo $QUERY_STRING | cut -d'=' -f1)"
VAL="$(echo $QUERY_STRING | cut -d'=' -f2)"
MODEL_SUFFIX=$(cat /tmp/sd/yi-hack/model_suffix)
if [ "$MODEL_SUFFIX" == "r40ga" ]; then
NUMCHAR=14
else
NUMCHAR=12
fi

if [ "$CONF" == "dirname" ]; then
DIR=$VAL
Expand All @@ -25,9 +20,9 @@ printf "\"records\":[\n"
COUNT=`ls -r /tmp/sd/record/$DIR | grep mp4 -c`
IDX=1
for f in `ls -r /tmp/sd/record/$DIR | grep mp4`; do
if [ ${#f} == $NUMCHAR ]; then
if [ ${#f} == 12 ] || [ ${#f} == 14 ]; then
printf "{\n"
if [ $NUMCHAR == 14 ]; then
if [ ${#f} == 14 ]; then
printf "\"%s\":\"%s\",\n" "time" "Time: ${DIR:11:2}:${f:2:2}"
else
printf "\"%s\":\"%s\",\n" "time" "Time: ${DIR:11:2}:${f:0:2}"
Expand Down

0 comments on commit 6e084f0

Please sign in to comment.