Posted on 09-28-2018 04:14 PM
Hi there everyone - I am attempting to streamline one of my scripts to install Centrify using path variables. I am able to run the commands by themselves but when I assign them as variables, failure city.
I will have a dmg file sitting in /private/var/Centrify5.5.1/CentrifyDC-5.5.1-x86_64.dmg that I would like to mount using hdiutil. Then I would install the contained pkg.
I'm attempting to make a variable, and I would assume that it is going to be
DMGPath="/private/var/Centrify5.5.1/CenrifyDC-5.5.1-x86_64.dmg" PKGPath="/Volumes/Centrify5.5.1/CentrifyDC-5.5.1.pkg"
I would like to have it be
hdiutil attach $DMGPath -nobrowse (don't need to see the mounted DMG)
installer -pkg $PKGPath
I keep getting hdiutil errors asking for an <image>
I would be grateful for any and all assistance.
Posted on 09-28-2018 04:15 PM
Ugh formatting. I meant to comment out the bolded lines. Sorry :p
Posted on 09-28-2018 05:09 PM
I have a similar script for Bomgar Jump Client and modified it for this use case.
Unfortunately, I can test it beyond that since I don't use Centrify but the script should work.
#!/bin/bash
dmgpath=/private/var/Centrify5.5.1/CenrifyDC-5.5.1-x86_64.dmg
pkgpath=/Volumes/Centrify5.5.1/CentrifyDC-5.5.1.pkg
if [ -f "$dmgpath" ]; then
echo "Centrify has been cached on the system"
# Attach the Disk Image
hdiutil attach -noverify -quiet "$dmgpath"
# Run the installer
if [ -d "$pkgpath" ]; then
installer -pkg "$pkgpath" -target /
else
echo "Problem mounting the Centrify DMG"
fi
else
echo "Centrify has not been cached on the system"
fi