From 6c641784adc0e4826afd4a4d2ccec1daafb77202 Mon Sep 17 00:00:00 2001 From: Botspot Date: Fri, 10 Sep 2021 15:42:45 -0500 Subject: [PATCH] updating 3-month-old installs: add notification & save backup --- manage | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/manage b/manage index 0974c44..6a8806d 100755 --- a/manage +++ b/manage @@ -39,14 +39,19 @@ EOF { 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 + yad --icon="${DIRECTORY}/icons/logo.png" --width=500 --no-buttons \ + --text="Your Pi-Apps github repository is somehow 3 months out-of-date."$'\n'"Downloading fresh version of pi-apps and saving the old version to ${DIRECTORY}-3-months-old..." & + sleep 1 + clear + echo "\nYour Pi-Apps github repository is somehow 3 months out-of-date.\nDownloading fresh version of pi-apps and saving the old version to ${DIRECTORY}-3-months-old...\n\n" 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}" + git clone "$(cat "${DIRECTORY}/etc/git_url")" pi-apps-forced-update 1>&2 && cp -af "${DIRECTORY}/data" ~/pi-apps-forced-update && mv -f "$DIRECTORY" "${DIRECTORY}-3-months-old" && mv -f ~/pi-apps-forced-update "${DIRECTORY}" temp_logfile="$(mktemp).txt" 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" + sleep 10 fi }