summaryrefslogtreecommitdiffstats
path: root/packaging/installer/functions.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-05-21 18:56:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-05-21 18:56:05 +0000
commit54deae27eed83a162ee438ef6bad4a23767757dd (patch)
treeda5333377dfacf22177375aef822a8e696f007eb /packaging/installer/functions.sh
parentReleasing debian version 1.14.0-1. (diff)
downloadnetdata-54deae27eed83a162ee438ef6bad4a23767757dd.tar.xz
netdata-54deae27eed83a162ee438ef6bad4a23767757dd.zip
Merging upstream version 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.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/packaging/installer/functions.sh b/packaging/installer/functions.sh
index 4270c4ee0..d1e944878 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