merge-requests/23/head
Christopher Roy Bratusek 5 years ago
parent 61acf33bd3
commit a47373453b

@ -2,12 +2,17 @@
export SHELL=${BASH}
if [ -w /data/media/0 ]; then
export HOME="/data/media/0"
elif [ -w /storage/self/primary ]; then
export HOME="/storage/self/primary"
# select storage path
if [ -n ${EXTERNAL_STORAGE} ]; then
export HOME="${EXTERNAL_STORAGE}/logcats"
else
export HOME="/sdcard"
if [ -w /sdcard ]; then
export HOME="/sdcard/logcats"
elif [ -w /storage/self/primary ]; then
export HOME="/storage/self/primary/logcats"
elif [ -w /data/media/0 ]; then
export HOME="/data/media/0/logcats"
fi
fi
export TMPDIR=${HOME}/.bash_tmp

@ -1,17 +1,19 @@
#!/system/bin/sh
# Set current date in 20170607-12.07.25 format
CURDATE=$(date +%Y%m%d-%I.%M.%S)
# wait until boot completed
until [ `getprop sys.boot_completed`. = 1. ]; do sleep 1; done
if [ -w /data/media/0 ]; then
LOGDIR="/data/media/0/logcats"
elif [ -w /storage/self/primary ]; then
LOGDIR="/storage/self/primary/logcats"
# select storage path
if [ -n ${EXTERNAL_STORAGE} ]; then
LOGDIR="${EXTERNAL_STORAGE}/logcats"
else
LOGDIR="/sdcard/logcats"
if [ -w /sdcard ]; then
LOGDIR="/sdcard/logcats"
elif [ -w /storage/self/primary ]; then
LOGDIR="/storage/self/primary/logcats"
elif [ -w /data/media/0 ]; then
LOGDIR="/data/media/0/logcats"
fi
fi
echo "logcat init script"
@ -23,6 +25,10 @@ echo "Starting Automatic Cleaning at $(date +"%m-%d-%Y %H:%M:%S")"
find /data/adb/logcat/ -print -mtime +8 -exec rm -f {} \; 2>/dev/null
echo "Automatic Cleaning finished at $(date +"%m-%d-%Y %H:%M:%S")"
# Set current date in 20170607-12.07.25 format
CURDATE=$(date +%Y%m%d-%I.%M.%S)
echo "Recording logcat to: ${LOGDIR}/${CURDATE}"
logcat -f "${LOGDIR}/${CURDATE}" &

@ -21,12 +21,17 @@ else
error "couldn't find NanoDroid!"
fi
if [ -w /data/media/0 ]; then
STORAGE="/data/media/0"
elif [ -w /storage/self/primary ]; then
STORAGE="/storage/self/primary"
# select storage path
if [ -n ${EXTERNAL_STORAGE} ]; then
STORAGE="${EXTERNAL_STORAGE}/logcats"
else
STORAGE="/sdcard"
if [ -w /sdcard ]; then
STORAGE="/sdcard/logcats"
elif [ -w /storage/self/primary ]; then
STORAGE="/storage/self/primary/logcats"
elif [ -w /data/media/0 ]; then
STORAGE="/data/media/0/logcats"
fi
fi
grep_prop() {

Loading…
Cancel
Save