summaryrefslogtreecommitdiffstats
path: root/packaging/installer/functions.sh
diff options
context:
space:
mode:
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