From 59b57ecffcc5474a56d6d4dfe3100cf9f236e1f2 Mon Sep 17 00:00:00 2001 From: Botspot Date: Fri, 10 Sep 2021 09:55:53 -0500 Subject: [PATCH] manage: more fixes to 3-month-old reinstall --- manage | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manage b/manage index f1ac2b3..0974c44 100755 --- a/manage +++ b/manage @@ -37,13 +37,14 @@ EOF #Silently re-download repo if github repository is over 3 months out of date { -if [ $(date +%s) -gt $(($(cd "$DIRECTORY"; git show -s --format=%ct) + 7776000)) ];then +current_git_date="$(cd "$DIRECTORY"; git show -s --format=%ct)" +if [ $(date +%s) -gt $(($current_git_date + 7776000)) ];then echo "Your Pi-Apps github repository is somehow 3 months out-of-date. Downloading fresh version of pi-apps..." 1>&2 cd $HOME rm -rf ~/pi-apps-forced-update - git clone "$(cat "${DIRECTORY}/etc/git_url")" pi-apps-forced-update 1>&2 && mv -f "${DIRECTORY}/data" ~/pi-apps-forced-update/data && rm -rf "$DIRECTORY" && mv -f ~/pi-apps-forced-update "${DIRECTORY}/data" + git clone "$(cat "${DIRECTORY}/etc/git_url")" pi-apps-forced-update 1>&2 && mv -f "${DIRECTORY}/data" ~/pi-apps-forced-update/data && rm -rf "$DIRECTORY" && mv -f ~/pi-apps-forced-update "${DIRECTORY}" temp_logfile="$(mktemp).txt" - echo -e "Silently updated a 3-months-outdated pi-apps install.\n$(get_device_info)" >> "$temp_logfile" + echo -e "Updated a 3-months-outdated pi-apps install.\nFrom: $current_git_date\nTo:$(cd "$DIRECTORY"; git show -s --format=%ct)\n$(get_device_info)" >> "$temp_logfile" send_error_report "$temp_logfile" 1>&2 rm -f "$temp_logfile" fi