From 82194a3b82cd1e82a0d48558f87c81363d35cde1 Mon Sep 17 00:00:00 2001 From: Botspot Date: Thu, 18 Mar 2021 10:51:02 -0500 Subject: [PATCH] Preload script fix multi-word categories & improve timestamping --- gui | 2 +- preload | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/gui b/gui index 80dbd04..8aae9a6 100755 --- a/gui +++ b/gui @@ -92,7 +92,7 @@ guimode="$(cat "${DIRECTORY}/data/settings/App List Style")" prefix='' while true;do - LIST="$("${DIRECTORY}/preload" $guimode $prefix)" + LIST="$("${DIRECTORY}/preload" $guimode "$prefix")" #LIST="$(cat "${DIRECTORY}/data/preload/LIST")" #echo "$LIST" diff --git a/preload b/preload index b2bd619..fee135f 100755 --- a/preload +++ b/preload @@ -41,7 +41,6 @@ mktimestamps() { checkdirs="${DIRECTORY}/apps ${DIRECTORY}/data/settings ${DIRECTORY}/data/status -${DIRECTORY}/data/categories ${DIRECTORY}/etc" timestamps='' @@ -50,15 +49,15 @@ ${DIRECTORY}/etc" for dir in $checkdirs do timestamps="$timestamps -${dir}/$(ls -t "$dir" | head -n1) -$(stat -c %Y "${dir}/$(ls -t "$dir" | head -n1)")" +dir $dir $(stat -c %Y "${dir}/$(ls -t "$dir" | head -n1)")" done IFS="$PREIFS" #remove first empty newline and check a few other things for changes too - timestamps="$prefix -$format -$(ls -1q "${DIRECTORY}/apps"/* | wc -l) -$(sha256sum "${DIRECTORY}/preload" | awk '{print $1}') + timestamps="prefix: $prefix +format: $format +number of files: $(ls -1q "${DIRECTORY}/apps"/* | wc -l) +preload shasum: $(sha256sum "${DIRECTORY}/preload" | awk '{print $1}') +structure shasum: $(shasum "${DIRECTORY}/data/categories/structure" | awk '{print $1}') ${timestamps:1}" } @@ -75,7 +74,9 @@ if [ -f "$timestampfile" ];then else #timestamps don't match, so reload the list reloadlist=1 - echo "Timestamps don"\'"t match" 1>&2 + echo "Timestamps don't match" 1>&2 + + echo -e "original file: $(cat "$timestampfile")\nnew timestamp: $timestamps" 1>&2 fi else #timestamp file not found @@ -83,7 +84,7 @@ else fi if [ ! -f "$listfile" ] || [ -z "$(cat "$listfile")" ];then - echo "list file does not exist." 1>&2 + echo "list file for $prefix does not exist." 1>&2 reloadlist=1 fi