Need to install 2 package in one script

Bhaskar
New Contributor

Hi 

I need to install 2 package file in Mac system via JAMF pro cloud. I have created 2 installer in 1 package file and add the script but in Jamf console is showing complete but setup in not run on the system

 

script is as below.

#!/bin/sh
## postinstall
 

/usr/sbin/installer -pkg /private/tmp/HPPrinter/hp-printer-essentials-UniPS-6_1_0_1.pkg -target /

/usr/sbin/installer -pkg /private/tmp/HP Secure Print/Personal Print Manager.pkg -target /

 

exit 0 ## Success
exit 1 ## Failure
 
so 1st installer run and then 2nd install this is sequence.
 
kindly correct if I written wrong script 
 
Thank you.
3 REPLIES 3

jamf-42
Valued Contributor II

usr/sbin/installer -pkg /private/tmp/HP Secure Print/Personal Print Manager.pkg -target /

 

Need space escaped

 

HP\ Secure\ Print/Pereonal\ Print\ Manager

Bhaskar
New Contributor

hi all.

 

Thank you for your reply .

 

So I have remove the space and create new script in package file 

/usr/sbin/installer -pkg /private/tmp/SecurePrinter/Printer_1.pkg -target /

now I am able to run the script without any issue and printer successful installed in Mac system via Jamf policy 

Thank you all for your guidance

 

karthikeyan_mac
Valued Contributor

@Bhaskar You can also try "quoting the package path in the second command like

/usr/sbin/installer -pkg "/private/tmp/HP Secure Print/Personal Print Manager.pkg" -target /