From 8adc5699741fef3c6e93b65655325ff35e699bbe Mon Sep 17 00:00:00 2001 From: Elliot Jordan Date: Wed, 23 Sep 2015 21:14:27 -0700 Subject: [PATCH] Checking md5 to ensure script has been customized. --- Exercise5c/create_pkg.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Exercise5c/create_pkg.sh b/Exercise5c/create_pkg.sh index d0c6178..ed44bc0 100755 --- a/Exercise5c/create_pkg.sh +++ b/Exercise5c/create_pkg.sh @@ -8,8 +8,8 @@ # pair to your managed clients. # Author: Elliot Jordan # Created: 2015-09-18 -# Last Modified: 2015-09-18 -# Version: 1.0 +# Last Modified: 2015-09-23 +# Version: 1.0.1 # ### @@ -25,25 +25,31 @@ if [[ ! -f "./auto_update_magic.sh" || exit 1 fi +script_md5=$(md5 -q ./auto_update_magic.sh) +if [[ "$script_md5" == "a1fd08b32853ca004212e98d7ea5a99e" ]]; then + echo "[ERROR] It looks like you haven't customized the auto_update_magic.sh script yet. Please do that now, then run create_pkg.sh again." + exit 2 +fi + read -p "[SANITY CHECK] Have you already added the TRIGGERS to auto_update_magic.sh? [y/n]: " -n 1 check_triggers echo if [[ "$check_triggers" != "y" && "$check_triggers" != "Y" ]]; then echo "You should go back and add the TRIGGERS to auto_update_magic.sh now, then run create_pkg.sh again." - exit 2 + exit 3 fi read -p "[SANITY CHECK] Have you already added the BLOCKING_APPS to auto_update_magic.sh? [y/n]: " -n 1 check_blocking_apps echo if [[ "$check_blocking_apps" != "y" && "$check_blocking_apps" != "Y" ]]; then echo "You should go back and add the BLOCKING_APPS to auto_update_magic.sh now, then run create_pkg.sh again." - exit 3 + exit 4 fi read -p "[SANITY CHECK] Have you already adjusted the StartInterval in the com.jamfsoftware.jamfnation.auto_update_magic LaunchDaemon to your liking? [y/n]: " -n 1 check_schedule echo if [[ "$check_schedule" != "y" && "$check_schedule" != "Y" ]]; then echo "You should go back and adjust the StartInterval now, then run create_pkg.sh again." - exit 4 + exit 5 fi echo "Great! Sounds like you're good to go."