Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -6060,9 +6060,15 @@ fi
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
# Use this to make sure root doesn't end up owning files
# shellcheck disable=SC2012
__owner=$(ls -ld . | awk '{print $3}')
# shellcheck disable=SC2012
__owner_group=$(ls -ld . | awk '{print $4}')
__dir_listing=$(ls -ld .)
__owner=$(awk '{print $3}' <<< "${__dir_listing}")
if [[ -g . ]]; then
# setgid: new files inherit directory group
__owner_group=$(awk '{print $4}' <<< "${__dir_listing}")
else
# no setgid: new files inherit owner's primary group
__owner_group=$(id -gn "${__owner}")
fi

if [[ "${__owner}" = "root" ]]; then
echo "Please install ${__project_name} as a non-root user."
Expand Down