From fb8ef7dd9a05742feaa707ce8d13429c320e70f6 Mon Sep 17 00:00:00 2001 From: Nick Bartzokas Date: Tue, 20 Dec 2016 19:50:05 -0500 Subject: [PATCH] Remove dependency on Packages payload. Default hostname to existing. Fix auto-login hash generation. Add log headings. --- MacProvisioner.pkgproj | 70 ++++++++++++++++++++++++++++++------------ install | 2 +- install_runasroot | 5 ++- install_runasuser | 6 +++- 4 files changed, 61 insertions(+), 22 deletions(-) diff --git a/MacProvisioner.pkgproj b/MacProvisioner.pkgproj index 3a46486..1d7f9fb 100755 --- a/MacProvisioner.pkgproj +++ b/MacProvisioner.pkgproj @@ -370,24 +370,7 @@ CHILDREN - - - CHILDREN - - GID - 0 - PATH - 1280x720.jpg - PATH_TYPE - 1 - PERMISSIONS - 420 - TYPE - 3 - UID - 0 - - + GID 0 PATH @@ -444,7 +427,56 @@ 1 RESOURCES - + + + CHILDREN + + GID + 0 + PATH + 1280x720.jpg + PATH_TYPE + 1 + PERMISSIONS + 420 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + install_runasroot + PATH_TYPE + 1 + PERMISSIONS + 493 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + install_runasuser + PATH_TYPE + 1 + PERMISSIONS + 493 + TYPE + 3 + UID + 0 + + PACKAGE_SETTINGS diff --git a/install b/install index cea956a..fc4b87a 100755 --- a/install +++ b/install @@ -1,7 +1,7 @@ #!/bin/bash # Prompt for ... -HOSTNAME="$(osascript -e 'Tell application "System Events" to display dialog "Enter the desired Hostname:" default answer "LAB-'$(uuidgen)'"' -e 'text returned of result' 2>/dev/null)" +HOSTNAME="$(osascript -e 'Tell application "System Events" to display dialog "Enter the desired Hostname:" default answer "'$(hostname)'"' -e 'text returned of result' 2>/dev/null)" USERNAME="$(osascript -e 'Tell application "System Events" to display dialog "Enter the default Username:" default answer "'$(whoami)'"' -e 'text returned of result' 2>/dev/null)" PASSWORD="$(osascript -e 'Tell application "System Events" to display dialog "Enter the default Password:" default answer ""' -e 'text returned of result' 2>/dev/null)" diff --git a/install_runasroot b/install_runasroot index 8d46850..1a41d83 100755 --- a/install_runasroot +++ b/install_runasroot @@ -5,6 +5,9 @@ HOSTNAME="$1" USERNAME="$2" PASSWORD="$3" +echo "####################" +echo "# install_runasroot" + # Begin sudo for rest of script #https://gist.github.com/cowboy/3118588 sudo -v @@ -62,7 +65,7 @@ echo "Setup auto login." # http://osxnotes.net/passwords.html # http://www.brock-family.org/gavin/perl/kcpassword.html sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser $USERNAME -sudo ruby -e"password=\"${PASSWORD}\".bytes; key=[125,137,82,35,210,188,221,234,163,185,31]; num=12*(1+password.size/12); out=Array.new(num); (0..num-1).each { |i| i