From 6d9514581abc09a05f6d86633bbd0bb08aab2cf5 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 20 Oct 2014 10:41:02 -0500 Subject: Let user decide if he wants to proceed to the upgrade when sha256 fails to download. Fixes #3576 --- etc/rc.initial.firmware_update | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'etc/rc.initial.firmware_update') diff --git a/etc/rc.initial.firmware_update b/etc/rc.initial.firmware_update index 1deff88..4ae9adb 100755 --- a/etc/rc.initial.firmware_update +++ b/etc/rc.initial.firmware_update @@ -87,7 +87,14 @@ switch ($command) { } else { echo "\n\nWARNING.\n"; echo "\nCould not locate a sha256 file. We cannot verify the download once completed.\n\n"; - sleep(15); + echo "Do you still want to proceed with the upgrade [n]? "; + $answer = strtoupper(chop(fgets($fp))); + if ($answer == "Y" or $answer == "YES") { + echo "\nContinuing upgrade..."; + } else { + echo "\nUpgrade cancelled.\n\n"; + die; + } } if(file_exists("/root/firmware.tgz.sha256")) { $source_sha256 = trim(`cat /root/firmware.tgz.sha256 | awk '{ print \$4 }'`,"\r"); -- cgit v1.1