diff --git a/setup.sh b/setup.sh index 1e625d1..b5d4e6f 100755 --- a/setup.sh +++ b/setup.sh @@ -2,6 +2,12 @@ set -e PROJECT_PATH=$(dirname $0) WHOAMI="$(id -un)" +if [ "$(uname -s)" = "Linux" ] +then + MYGROUP="${WHOAMI}" +else + MYGROUP="staff" +fi if [ $(id -u) -eq 0 ] then @@ -20,10 +26,10 @@ check() { setup_base() { printf 'Change ownership of "%s" to "%s"? (setup may fail otherwise)\n' "${PROJECT_PATH}" "${WHOAMI}" - printf 'running: "sudo chown -R %s %s"\n' "${WHOAMI}:${WHOAMI}" "${PROJECT_PATH}" + printf 'running: "sudo chown -R %s %s"\n' "${WHOAMI}:${MYGROUP}" "${PROJECT_PATH}" if check 'Continue? [Y/n] ' then - sudo chown -R "${WHOAMI}:${WHOAMI}" "${PROJECT_PATH}" + sudo chown -R "${WHOAMI}:${MYGROUP}" "${PROJECT_PATH}" fi