From 0b192ef51527fb6583261accf57809be3b468654 Mon Sep 17 00:00:00 2001 From: Jack <31696646+myspaghetti@users.noreply.github.com> Date: Mon, 15 Jul 2019 05:07:44 +0300 Subject: [PATCH] fail if xxd fails and ROM or UUID are modified SECRET DEPENDENCY --- macos-guest-virtualbox.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/macos-guest-virtualbox.sh b/macos-guest-virtualbox.sh index 9764edc..8929348 100644 --- a/macos-guest-virtualbox.sh +++ b/macos-guest-virtualbox.sh @@ -2,7 +2,7 @@ # Semi-automatic installer of macOS on VirtualBox # (c) myspaghetti, licensed under GPL2.0 or higher # url: https://github.com/img2tab/macos-guest-virtualbox -# version 0.71.4 +# version 0.71.5 # Requirements: 40GB available storage on host # Dependencies: bash >= 4.0, unzip, wget, dmg2img, @@ -52,8 +52,16 @@ if [ -n "$(echo -n "aabbccddee" | xxd -r -p 2>/dev/null)" ]; then UUID_b64="$(echo -n "${UUID}" | xxd -r -p | base64)" UUID="bytes:${UUID_b64}" else - ROM="bytes:qiq7Z8zd" # base64 of the example ROM - UUID="bytes:qrvM3e7/ABEiM0RVZneImQ==" # base64 of the example UUID + if [ "${ROM}" = '%aa*%bbg%cc%dd' -a "${UUID}" = "aabbccddeeff00112233445566778899" ]; then + ROM="bytes:qiq7Z8zd" # base64 of the example ROM + UUID="bytes:qrvM3e7/ABEiM0RVZneImQ==" # base64 of the example UUID + else + echo "ROM and UUID variables have been assigned non-default values. Applying these" + echo "values to the virtual machine requires the package xxd. Please make sure the" + echo "package xxd is installed." + echo "Exiting." + exit + fi fi # welcome message