From 5b1b429f4da0bc05775d7a66d45608094653cfa2 Mon Sep 17 00:00:00 2001 From: shim_ Date: Mon, 13 Jun 2016 15:49:05 +0200 Subject: [PATCH] use cached installr --- init.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/init.sh b/init.sh index 30ce38a..a9ed91d 100755 --- a/init.sh +++ b/init.sh @@ -10,9 +10,7 @@ function report_loop { done } -if [ -f "$BINARY" ]; then - report_loop -else +function fetch_installer { curl "$RTM_DOWNLOAD_URL$RTM_VERSION" > $INSTALLER CHECKSUM=$(sha256sum $INSTALLER) if [ "$CHECKSUM" -eq "$RTM_INSTALLER_CHECKSUM $INSTALLER" ]; then @@ -23,4 +21,14 @@ else echo Checksum mismatch! exit 1 fi +} + +if [ -f "$BINARY" ]; then + report_loop +else + if [ -f "$INSTALLER" ]; then + $INSTALLER + else + fetch_installer + fi fi