@@ -41,7 +41,7 @@ SCRIPTDIR="/usr/local/bin"
4141
4242echo " Welcome to Munki-in-a-Box. We're going to get things rolling here with a couple of tests" ' !'
4343
44- echo " First up: Are you an admin user?"
44+ echo " First up: Are you an admin user? Enter your password below: "
4545
4646# Let's see if this works...
4747# This isn't bulletproof, but this is a basic test.
123123
124124if
125125 [[ ! -f $MUNKILOC /munkiimport ]]; then
126+ cd ${REPOLOC}
126127 ${LOGGER} " Grabbing and Installing the Munki Tools Because They Aren't Present"
127- curl -L " https://munkibuilds.org/munkitools2-latest.pkg" -o " $REPOLOC /munkitools2.pkg"
128-
128+ MUNKI_LATEST=$( curl https://api.github.com/repos/munki/munki/releases/latest | python -c ' import json,sys;obj=json.load(sys.stdin);print obj["assets"][0]["browser_download_url"]' )
129+
130+ curl -L " ${MUNKI_LATEST} " -o munki-latest1.pkg
131+
129132# Write a Choices XML file for the Munki package. Thanks Rich and Greg!
130133
131134 /bin/cat > " /tmp/com.github.munki-in-a-box.munkiinstall.xml" << 'MUNKICHOICESDONE '
168171</plist>
169172MUNKICHOICESDONE
170173
171- /usr/sbin/installer -dumplog -verbose -applyChoiceChangesXML " /tmp/com.github.munki-in-a-box.munkiinstall.xml" -pkg " $REPOLOC /munkitools2 .pkg" -target " /"
174+ sudo /usr/sbin/installer -dumplog -verbose -applyChoiceChangesXML " /tmp/com.github.munki-in-a-box.munkiinstall.xml" -pkg " munki-latest1 .pkg" -target " /"
172175
173176 ${LOGGER} " Installed Munki Admin and Munki Core packages"
174177 echo " Installed Munki packages"
@@ -310,14 +313,14 @@ echo "AutoPkg Installed"
310313# ###
311314
312315
313- sudo ${DEFAULTS} write com.github.autopkg MUNKI_REPO " $REPODIR "
316+ ${DEFAULTS} write com.github.autopkg MUNKI_REPO " $REPODIR "
314317
315318${AUTOPKG} repo-add http://github.com/autopkg/recipes.git
316319
317- sudo ${DEFAULTS} write com.googlecode.munki.munkiimport editor " ${TEXTEDITOR} "
318- sudo ${DEFAULTS} write com.googlecode.munki.munkiimport repo_path " ${REPODIR} "
319- sudo ${DEFAULTS} write com.googlecode.munki.munkiimport pkginfo_extension .plist
320- sudo ${DEFAULTS} write com.googlecode.munki.munkiimport default_catalog testing
320+ ${DEFAULTS} write com.googlecode.munki.munkiimport editor " ${TEXTEDITOR} "
321+ ${DEFAULTS} write com.googlecode.munki.munkiimport repo_path " ${REPODIR} "
322+ ${DEFAULTS} write com.googlecode.munki.munkiimport pkginfo_extension .plist
323+ ${DEFAULTS} write com.googlecode.munki.munkiimport default_catalog testing
321324
322325${LOGGER} " AutoPkg Configured"
323326echo " AutoPkg Configured"
@@ -433,10 +436,10 @@ echo "<?php" > ${MR_CONFIG}
433436echo >> ${MR_CONFIG}
434437echo " \$ conf['pdo_dsn'] = 'sqlite:$MR_DB_DIR /db.sqlite';" >> ${MR_CONFIG}
435438
436- echo " short_open_tag = On" >> " ${PHPROOT} /php.ini"
439+ sudo echo " short_open_tag = On" >> " ${PHPROOT} /php.ini"
440+ # This creates a user "root" with password "root"
437441echo " \$ auth_config['root'] = '\$ P\$ BSQDsvw8vyCZxzlPaEiXNoP6CIlwzt/';" >> ${MR_CONFIG}
438442
439- # This creates a user "root" with password "root"
440443# Now to download the pkgsinfo file into the right place and add it to the catalogs and site_default manifest:
441444
442445echo " Downloading available modules"
@@ -466,15 +469,18 @@ chmod -R a+rX,g+w "${REPONAME}"
466469chown -R ${ADMINUSERNAME} :admin " ${REPONAME} "
467470
468471rm " $REPOLOC /autopkg-latest1.pkg"
469- rm " $REPOLOC /munkitools2 .pkg"
472+ rm " $REPOLOC /munki-latest1 .pkg"
470473rm " $REPOLOC /munkireport-" * .pkg
471474
472475${LOGGER} " I put my toys away."
473476
477+ echo " #########"
474478echo " Thank you for flying Munki in a Box Air. You now have a working repo, go forth and install your clients."
475-
476- echo " MunkiAdmin and AutoPkgr are ready to go, please launch them to complete their setup. MunkiAdmin needs to know where your repo is, and AutoPkgr needs to have its helper tool installed."
477-
479+ echo " #########"
480+ echo " MunkiAdmin and AutoPkgr are ready to go, please launch them to complete their setup."
481+ echo " #########"
482+ echo " MunkiAdmin needs to know where your repo is, and AutoPkgr needs to have its helper tool installed."
483+ echo " #########"
478484echo " Be sure to login to MunkiReport-PHP at http://localhost/munkireport-php and initiate the database, as well change the login password."
479485
480- exit 0
486+ exit 0
0 commit comments