diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-05-21 18:55:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-05-21 18:55:22 +0000 |
commit | 61d0027904ee9c040985b1642ca228737d616d03 (patch) | |
tree | c90838c137b4dc4a2de1cff9f2d7be5552d605e7 /packaging/installer/functions.sh | |
parent | Adding upstream version 1.14.0. (diff) | |
download | netdata-61d0027904ee9c040985b1642ca228737d616d03.tar.xz netdata-61d0027904ee9c040985b1642ca228737d616d03.zip |
Adding upstream version 1.15.0.upstream/1.15.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/installer/functions.sh')
-rw-r--r-- | packaging/installer/functions.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packaging/installer/functions.sh b/packaging/installer/functions.sh index 4270c4ee..d1e94487 100644 --- a/packaging/installer/functions.sh +++ b/packaging/installer/functions.sh @@ -606,6 +606,11 @@ portable_add_user() { run adduser -h "${homedir}" -s "${nologin}" -D -G "${username}" "${username}" && return 0 fi + # mac OS + if command -v sysadminctl 1> /dev/null 2>&1; then + run sysadminctl -addUser ${username} && return 0 + fi + echo >&2 "Failed to add ${username} user account !" return 1 @@ -637,6 +642,11 @@ portable_add_group() { run addgroup "${groupname}" && return 0 fi + # mac OS + if command -v dseditgroup 1> /dev/null 2>&1; then + dseditgroup -o create "${groupname}" && return 0 + fi + echo >&2 "Failed to add ${groupname} user group !" return 1 } @@ -674,6 +684,10 @@ portable_add_user_to_group() { run addgroup "${username}" "${groupname}" && return 0 fi + # mac OS + if command -v dseditgroup 1> /dev/null 2>&1; then + dseditgroup -u "${username}" "${groupname}" && return 0 + fi echo >&2 "Failed to add user ${username} to group ${groupname} !" return 1 fi |