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

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

@ -1,17 +1,19 @@
#!/system/bin/sh #!/system/bin/sh
# Set current date in 20170607-12.07.25 format
CURDATE=$(date +%Y%m%d-%I.%M.%S)
# wait until boot completed # wait until boot completed
until [ `getprop sys.boot_completed`. = 1. ]; do sleep 1; done until [ `getprop sys.boot_completed`. = 1. ]; do sleep 1; done
if [ -w /data/media/0 ]; then # select storage path
LOGDIR="/data/media/0/logcats" if [ -n ${EXTERNAL_STORAGE} ]; then
elif [ -w /storage/self/primary ]; then LOGDIR="${EXTERNAL_STORAGE}/logcats"
LOGDIR="/storage/self/primary/logcats"
else 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 fi
echo "logcat init script" 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 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")" 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}" echo "Recording logcat to: ${LOGDIR}/${CURDATE}"
logcat -f "${LOGDIR}/${CURDATE}" & logcat -f "${LOGDIR}/${CURDATE}" &

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

Loading…
Cancel
Save