You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,6 @@ munki-in-a-box
3
3
4
4
Post Munki Install Simple Deployment Script
5
5
6
-
7
6
The goal of this script is to deploy a basic munki repo in a simple script based on a set of common variables. I have placed defaults in these variables, but they are easily overridden and you should decide where they go.
8
7
9
8
This script is based upon the Demonstration Setup Guide for Munki, AutoPKG, and other sources. My sincerest thanks to Greg Neagle, Tim Sutton, Allister Banks, Rich Trouton, Charles Edge, Pepijn Bruienne, the Linde Group and numerous others who have helped me assemble this script. The Mac Admins Community is supportive and awesome.
@@ -20,7 +19,7 @@ This script is based upon the Demonstration Setup Guide for Munki, AutoPKG, and
20
19
3) Alter Line 32 to reflect your choice of AutoPKG installs
21
20
4) Alter Line 35 to reflect your admin username (ladmin is default)
22
21
5) Alter Lines 37-38 to reflect AutoPKG Automation Scripts
23
-
6)sudo ./munkiinabox.sh
22
+
6) ./munkiinabox.sh
24
23
25
24
If you do not make changes to the script before running it, the script may not run as intended. Please double-check to make sure that you are comfortable with the variables' values.
26
25
@@ -65,6 +64,10 @@ For more information on munkireport-php, please be sure to [visit their document
65
64
66
65
###Changelog
67
66
67
+
**NEW in 1.4.0:**
68
+
69
+
• No more running as root!
70
+
68
71
**NEW in 1.3.0:**
69
72
70
73
• Updated deployment technique for Munkireport-php, thanks to A.E. von Bochoven.
Copy file name to clipboardExpand all lines: munkiinabox.sh
+60-30Lines changed: 60 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
# Munki In A Box
4
4
# By Tom Bridge, Technolutionary LLC
5
5
6
-
# Version: 1.3.0 - New MunkiReport-PHP
6
+
# Version: 1.4.0 - Non-Root Execution
7
7
8
8
# This software carries no guarantees, warranties or other assurances that it works. It may wreck your entire environment. That would be bad, mmkay. Backup, test in a VM, and bug report.
9
9
@@ -13,7 +13,7 @@
13
13
14
14
# This script is based upon the Demonstration Setup Guide for Munki, AutoPkg, and other sources. My sincerest thanks to Greg Neagle, Tim Sutton, Allister Banks, Rich Trouton, Charles Edge, Hannes Juutilainen, Sean Kaiser, Peter Bukowinski, Elliot Jordan, The Linde Group and numerous others who have helped me assemble this script.
15
15
16
-
# Pre-Reqs for this script: 10.8/Server 2, 10.9/Server 3 or 10.10/Server 4. Web Services should be turned on and PHP should be enabled.
16
+
# Pre-Reqs for this script: 10.10/Server 4 or 10.11/Server 5. Web Services should be turned on and PHP should be enabled. This script might work with 10.8 or later, but I'm only testing it on 10.10 or later.
17
17
18
18
# Establish our Basic Variables:
19
19
@@ -41,6 +41,20 @@ SCRIPTDIR="/usr/local/bin"
41
41
42
42
echo"Welcome to Munki-in-a-Box. We're going to get things rolling here with a couple of tests"'!'
43
43
44
+
echo"First up: Are you an admin user? Enter your password below:"
45
+
46
+
#Let's see if this works...
47
+
#This isn't bulletproof, but this is a basic test.
echo"This script is intended for OS X 10.10 or later. It may work on 10.8 or 10.9, but the ride may be a bit bumpy, and things may not go quite the way the script intended them to go. In short, this is not supported, but it probably won't light anything on fire. Be aware."
$echo"This script must run as root. Type sudo $0, then press [ENTER]."
86
-
exit 4 #Not running as root.
105
+
[[ $EUID-eq 0 ]];then
106
+
$echo"This script is NOT MEANT to run as root. This script is meant to be run as an admin user. I'm going to quit now. Run me without the sudo, please."
107
+
exit 4 #Running as root.
87
108
fi
88
109
89
-
${LOGGER}"Script is running as root."
110
+
#${LOGGER} "Script is running as root."
90
111
91
112
if
92
113
[[ !-d"${WEBROOT}" ]];then
@@ -102,9 +123,12 @@ fi
102
123
103
124
if
104
125
[[ !-f$MUNKILOC/munkiimport ]];then
126
+
cd${REPOLOC}
105
127
${LOGGER}"Grabbing and Installing the Munki Tools Because They Aren't Present"
# This makes AutoPkg useful on future runs for the admin user defined at the top. It copies & creates preferences for autopkg and munki into their home dir's Library folder, as well as transfers ownership for the ~/Library/AutoPkg folders to them.
echo"Thank you for flying Munki in a Box Air. You now have a working repo, go forth and install your clients."
454
-
455
-
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."
456
-
482
+
echo"#########"
483
+
echo"MunkiAdmin and AutoPkgr are ready to go, please launch them to complete their setup."
484
+
echo"#########"
485
+
echo"MunkiAdmin needs to know where your repo is, and AutoPkgr needs to have its helper tool installed."
486
+
echo"#########"
457
487
echo"Be sure to login to MunkiReport-PHP at http://localhost/munkireport-php and initiate the database, as well change the login password."
0 commit comments