#!/bin/bash
# Adjust file settings !
# Set ownership to current user if he installs under /Users.
# Note: Don't use $UID because it's root's UID here (=0)! $USER works.

if [[ $2 =~ /Users/.* ]]; then
   chown -R $USER:admin "$2"
else
   chown -R root:admin "$2"
fi

chmod -R g+w "$2"
exit 0
 