Skip to main content

I am looking to Execute Absolute Full Agent, however the PKG relies on a few other files, how can I accomplish this as it seems to have an error code of 0 - getcwd with my script. 










#!/bin/sh

## postinstall

 

pathToScript=$0

pathToPackage=$1

targetLocation=$2

targetVolume=$3

 

if sysctl machdep.cpu.brand_string | grep -w "Intel"  ; then

sudo -S installer -allowUntrusted -verboseR -pkg "/private/tmp/Absolute5.10.25/AbsoluteFullAgent.pkg" -target /

 

fi

 

rm -rf "/Private/tmp/Absolute5.10.25/" 2>dev/null

 

 

exit 0 ## Success

exit 1 ## Failure

 


 

You probably need to contact the vendor/developer for assistance. 


 


You can try to place all the source files in the directory you are wanting to use, and run that post install command from terminal directly to execute it. It's always best to debug before you package the stuff and try to upload it to Jamf.


You probably need to contact the vendor/developer for assistance. 


 


You can try to place all the source files in the directory you are wanting to use, and run that post install command from terminal directly to execute it. It's always best to debug before you package the stuff and try to upload it to Jamf.


Actually, the above postinstall script works, i found my own issue and I noticed there is no space between # & !


Below is the Modified Script



# !/bin/sh

## postinstall

 

pathToScript=$0

pathToPackage=$1

targetLocation=$2

targetVolume=$3

 

if sysctl machdep.cpu.brand_string | grep -w "Intel"  ; then

sudo -S installer -allowUntrusted -verboseR -pkg "/private/tmp/Absolute5.10.25/AbsoluteFullAgent.pkg" -target /

 

fi

 

rm -rf "/Private/tmp/Absolute5.10.25/" 2>dev/null

 

 

exit 0 ## Success

exit 1 ## Failure


Actually, the above postinstall script works, i found my own issue and I noticed there is no space between # & !


Below is the Modified Script



# !/bin/sh

## postinstall

 

pathToScript=$0

pathToPackage=$1

targetLocation=$2

targetVolume=$3

 

if sysctl machdep.cpu.brand_string | grep -w "Intel"  ; then

sudo -S installer -allowUntrusted -verboseR -pkg "/private/tmp/Absolute5.10.25/AbsoluteFullAgent.pkg" -target /

 

fi

 

rm -rf "/Private/tmp/Absolute5.10.25/" 2>dev/null

 

 

exit 0 ## Success

exit 1 ## Failure


@JuanMoya93 A postinstall script is already running as a privileged process so using sudo to elevate privileges is unnecessary, and the allowUntrusted isn't necessary when running the install via the jamf binary, so your call to the installer tool can simply be:


/usr/sbin/installer -pkg "/private/tmp/Absolute5.10.25/AbsoluteFullAgent.pkg" -target /


Reply