When I run a .pkg file in AirWatch it doesn't install when I run it normally it works fine. This is my post install script:
!/bin/sh
postinstall
pathToScript=$0
pathToPackage=$1
targetLocation=$2
targetVolume=$3
loggedInUser=/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'
mv /tmp/Microsoft /Users/$USER/Library/Application Support/
chown -R $loggedInUser:staff /Users/$USER/Library/Application Support/Microsoft
exit 0 ## Success
exit 1 ## Failure