createlog: bring sanity to kodi log order

This commit is contained in:
MilhouseVH 2017-04-27 22:52:24 +01:00
parent 05f5831370
commit d7e4c1993d

View File

@ -24,7 +24,7 @@ DATE=`date -u +%Y-%m-%d-%H.%M.%S`
BASEDIR="/tmp"
LOGDIR="log-$DATE"
RELEASE="`cat /etc/release`"
GIT="`cat /etc/issue |grep git`"
GIT="`cat /etc/issue | grep git`"
getlog_cmd() {
if command -v $1 >/dev/null; then
@ -74,8 +74,24 @@ rm -rf $BASEDIR/$LOGDIR
mkdir -p $BASEDIR/$LOGDIR
# kodi.log
KODI_LOG_DIR=/storage/.kodi/temp
LOGFILE="01_KODI.log"
for i in `find /storage/.kodi/temp/ -type f -name "*.log"`; do
for i in kodi.log kodi.old.log; do
[ -f ${KODI_LOG_DIR}/${i} ] && getlog_cmd cat ${KODI_LOG_DIR}/$i
done
LOGFILE="01_KODI_CRASH.log"
for i in `find ${KODI_LOG_DIR} -type f -name "kodi_crashlog_*.log" | sort -r`; do
getlog_cmd cat $i
done
LOGFILE="01_KODI_OTHER.log"
for i in `find ${KODI_LOG_DIR} -type f -name "*.log" | sort`; do
iname="${i#${KODI_LOG_DIR}/}"
[ ${iname} == kodi.log ] && continue
[ ${iname} == kodi.old.log ] && continue
[ "${iname#kodi_crashlog_}" != "${iname}" ] && continue
getlog_cmd cat $i
done