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