From 30ae194d04bceb7543228b942058b658859b54d2 Mon Sep 17 00:00:00 2001 From: bgkillas <55570525+bgkillas@users.noreply.github.com> Date: Mon, 28 Nov 2022 16:03:09 -0500 Subject: [PATCH 1/2] make get_recordings simpler the A*.wav is to get rid of wave.wav which apears in /tmp sometimes i think from call me also this seems incredibly prone to overwritting files because the file names are not in actual time they are in time since the modems boot at least for me but i wont publish a fix for that rn --- .../retrieve_recordings/get_recordings | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/tools/helpers/retrieve_recordings/get_recordings b/tools/helpers/retrieve_recordings/get_recordings index 0da52e0..3b2e538 100644 --- a/tools/helpers/retrieve_recordings/get_recordings +++ b/tools/helpers/retrieve_recordings/get_recordings @@ -1,21 +1,8 @@ -#!/bin/bash +#!/bin/sh TARGETPATH="/path/to/save/the/recordings/" -FILESTMP=`adb shell ls /tmp/` -FILESPERSIST=`adb shell ls /persist/` mkdir -p $TARGETPATH cd $TARGETPATH -for file in $FILESTMP; do - if [[ $file =~ .*\.(wav) ]]; then - THISFILE=$(echo $file|tr -d '\n'|tr -d '\r') - echo "Pulling "$THISFILE - adb pull /tmp/${THISFILE} && adb shell rm /tmp/${THISFILE} - fi -done; -for file in $FILESPERSIST; do - if [[ $file =~ .*\.(wav) ]]; then - THISFILE=$(echo $file|tr -d '\n'|tr -d '\r') - echo "Pulling "$THISFILE - adb pull /persist/${THISFILE} && adb shell rm /tmp/${THISFILE} - fi -done; - +for file in $(adb shell 'ls -1d /tmp/A*.wav /persist/A*.wav 2>/dev/null'|tr -d '\r');do + echo "Pulling $file" + adb pull $file && adb shell rm $file || echo "Failed to Pull $file" +done From 8cb789dfe4023ad8930d65bd566248f1f91a234f Mon Sep 17 00:00:00 2001 From: bgkillas <55570525+bgkillas@users.noreply.github.com> Date: Tue, 29 Nov 2022 06:06:26 -0500 Subject: [PATCH 2/2] Update get_recordings --- tools/helpers/retrieve_recordings/get_recordings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/helpers/retrieve_recordings/get_recordings b/tools/helpers/retrieve_recordings/get_recordings index 3b2e538..846aca8 100644 --- a/tools/helpers/retrieve_recordings/get_recordings +++ b/tools/helpers/retrieve_recordings/get_recordings @@ -2,7 +2,7 @@ TARGETPATH="/path/to/save/the/recordings/" mkdir -p $TARGETPATH cd $TARGETPATH -for file in $(adb shell 'ls -1d /tmp/A*.wav /persist/A*.wav 2>/dev/null'|tr -d '\r');do +for file in $(adb shell 'ls -1d /tmp/[A-Z]*.wav /persist/[A-Z]*.wav 2>/dev/null'|tr -d '\r');do echo "Pulling $file" adb pull $file && adb shell rm $file || echo "Failed to Pull $file" done