From 6c6600dd5a063a00a8ba8a9b9e1b8aca56a2e984 Mon Sep 17 00:00:00 2001 From: Alfonso Gamboa Date: Sun, 29 May 2022 01:18:43 -0700 Subject: [PATCH] continue work on upgrade script --- SD_ROOT/wz_mini/etc/wireguard/.gitignore | 0 SD_ROOT/wz_mini/usr/bin/ucamera | Bin SD_ROOT/wz_mini/usr/bin/upgrade-run.sh | 14 ++++++++------ 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 SD_ROOT/wz_mini/etc/wireguard/.gitignore mode change 100644 => 100755 SD_ROOT/wz_mini/usr/bin/ucamera diff --git a/SD_ROOT/wz_mini/etc/wireguard/.gitignore b/SD_ROOT/wz_mini/etc/wireguard/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/SD_ROOT/wz_mini/usr/bin/ucamera b/SD_ROOT/wz_mini/usr/bin/ucamera old mode 100644 new mode 100755 diff --git a/SD_ROOT/wz_mini/usr/bin/upgrade-run.sh b/SD_ROOT/wz_mini/usr/bin/upgrade-run.sh index 1717a06..6b74d3a 100755 --- a/SD_ROOT/wz_mini/usr/bin/upgrade-run.sh +++ b/SD_ROOT/wz_mini/usr/bin/upgrade-run.sh @@ -1,6 +1,8 @@ #!/bin/sh setup() { +exec 1>> /opt/wz_upgrade.log 2>&1 + mkdir /opt/Upgrade mkdir /opt/Upgrade/preserve wget --no-check-certificate https://github.com/gtxaspec/wz_mini_hacks/archive/refs/heads/master.zip -O /opt/Upgrade/wz_mini.zip; sync @@ -15,8 +17,11 @@ reboot upgrade_mode_start() { exec 1>> /opt/wz_upgrade.log 2>&1 + set -x + echo UPGRADE MODE + umount /opt/wz_mini/tmp rm -rf /opt/wz_mini/* mv /opt/Upgrade/wz_mini_hacks-master/SD_ROOT/wz_mini/* /opt/wz_mini/ @@ -36,11 +41,11 @@ reboot if [[ -e /tmp/dbgflag ]]; then upgrade_mode_start else -read -r -p "${1:-wz_mini, this will download the latest version and upgrade your system. Are you sure? [y/N]} " response +read -r -p "${1:-wz_mini, this will download the latest version from github and upgrade your system. Are you sure? [y/N]} " response case "$response" in [yY][eE][sS]|[yY]) if [[ -d /opt/Upgrade ]]; then - echo "old Upgrade dir exists" + echo "WARNING: Old Upgrade directory exists" read -r -p "${1:-Unable to proceed, must DELETE old Upgrade directory, are you sure? [y/N]} " response case "$response" in [yY][eE][sS]|[yY]) @@ -58,10 +63,7 @@ read -r -p "${1:-wz_mini, this will download the latest version and upgrade your ;; *) - echo "user denied update" + echo "User declined system update, exit" ;; esac - - - fi