Posted on 01-28-2015 01:45 PM
I seem to be having a problem building machines. Our first boot script, which we've been using since November, has a section that determines if a machine is a laptop or a desktop, and if it's a laptop it calls down the policy via trigger
##########################################
# Install VPN if MacBook
##########################################
/bin/echo "Install VPN if MacBook"
/bin/date
# Detects if this Mac is a laptop or not by checking the model ID for the
word "Book" in the name.
IS_LAPTOP=`/usr/sbin/system_profiler SPHardwareDataType | grep "Model
Identifier" | grep "Book"`
if [[ $shortModel == "MacBook" ]]; then
jamf policy trigger F5VPN
else
/bin/echo "VPN Not Installed, desktop machine"
Fi
the logs then show it's running that policy, then checks for recurring check-in policies and installs all of them.
##########################################
# Install VPN if MacBook
##########################################
/bin/echo "Install VPN if MacBook"
+ /bin/echo 'Install VPN if MacBook'
Install VPN if MacBook
/bin/date
+ /bin/date
Wed Jan 28 12:02:41 PST 2015
# Detects if this Mac is a laptop or not by checking the model ID for the
word "Book" in the name.
IS_LAPTOP=`/usr/sbin/system_profiler SPHardwareDataType | grep "Model
Identifier" | grep "Book"`
/usr/sbin/system_profiler SPHardwareDataType | grep "Model Identifier" |
grep "Book"
++ /usr/sbin/system_profiler SPHardwareDataType
++ grep 'Model Identifier'
++ grep Book
+ IS_LAPTOP=' Model Identifier: MacBookPro11,2'
if [[ $shortModel == "MacBook" ]]; then
jamf policy trigger F5VPN
else
/bin/echo "VPN Not Installed, desktop machine"
fi
+ [[ MacBook == MacBook ]]
+ jamf policy trigger F5VPN
Checking for policies triggered by "recurring check-in"...
Executing Policy Citrix Receiver - Aprimo...
Mounting Hoffman to /Volumes/CasperShare...
Verifying package integrity...
Installing Citrix Receiver 11.8.2.dmg...
Closing package...
Submitting log to https:///
Executing Policy F5 VPN Test Group...
Verifying package integrity...
Installing F5-VIP.dmg...
Closing package...
Verifying package integrity...
Installing F5VPN.pkg_0814.2030.zip...
Successfully installed F5VPN.pkg_0814.2030.zip.
Submitting log to https:///
Executing Policy Flash Auto Update...
Running script AutoUpdate Flash...
Script exit code: 0
Script result: /dev/disk1 Apple_partition_scheme
/dev/disk1s1 Apple_partition_map
/dev/disk1s2 Apple_HFS
/private/tmp/flashplayer.uOOa
installer: Package name is Adobe Flash Player
installer: Installing at base path /
installer: Preparing for installation….....
installer: Preparing the disk….....
installer: Preparing Adobe Flash Player….....
installer: Waiting for other installations to complete….....
installer: Configuring the installation….....
installer:
#
installer: Writing files….....
#
installer: Writing files….....
#
installer: Running package scripts….....
#
installer: Running package scripts….....
#
installer: Running package scripts….....
installer: Validating packages….....
#
installer: Running installer actions…
installer:
installer: Finishing the Installation….....
installer:
#
installer: The software was successfully installed......
installer: The install was successful.
"disk1" unmounted.
"disk1" ejected.
Submitting log to https:///
Executing Policy Inventory Update...
Submitting log to https:///
Executing Policy Trend - Primary Server...
Verifying package integrity...
Installing tmsminstall_20.mpkg.zip...
Successfully installed tmsminstall_20.mpkg.zip.
Running Recon...
Retrieving inventory preferences from https://jss/...
Finding extension attributes...
Locating applications...
Locating accounts...
Locating package receipts...
Searching path: /Applications
Locating software updates...
Locating plugins...
Searching path: /Library/Internet Plug-Ins
Locating hard drive information...
Locating hardware information (Mac OS X 10.10.2)...
finally it freezes up at the locating hardware info portion and does not proceed further.
if I take out the FB script then everything is fine. The thing that I don't get is that the same scripts and apps (some may have been updated, FF, Chrome, etc) have been in place since November, and this has only started occurring of the last week or so...
Posted on 01-28-2015 01:56 PM
Your syntax to call the policy is wrong. It should be:
jamf policy -trigger F5VPN
Otherwise it will run all policies that are in scope.
Posted on 01-28-2015 03:01 PM
Not sure if I'm just missing it but I can't see the variable ```
$shortModel
``` defined before the if?
It sounds like there is something else going on if its getting stuck locating hardware info. Hopefully this isn't a new 10.10.2 incompatibility.
From memory I think you can set the scope for the policy to MacBook models only. If an out of scope device calls it via a script it will just skip it. Could be an alternative to the "if" MacBook part.
Posted on 01-29-2015 06:28 AM
@davidacland it's further up in the script - shortModel=system_profiler SPHardwareDataType | grep 'Model Name:' | awk '{ print $3 }'
@stevewood - ugh, yes. that pesky hyphen. i added that and now the script finishes (THANK YOU!!) but now it just gets hung up somewhere else. Left it sitting all night, i think it's on the recon at the end of my workflow (at least before adding the hyphen that's where it was locking up).
Posted on 02-02-2015 08:15 AM
@jwojda Curious, do you run your SWU as part of the first boot? I know it's not related to your question, but noticed the bottom part of your screen shot. I am trying to have all the updates installed post imaging at first boot, instead of calling via policy with the custom trigger in the post image proccess.