Skip to content

Commit 3182a31

Browse files
authored
Merge pull request #4320 from catap/openbsd
ejabberdctl: support OpenBSD su
2 parents 59f5621 + 5de3bac commit 3182a31

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

ejabberdctl.template

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,19 @@ set_dist_client()
132132
# run command either directly or via su $INSTALLUSER
133133
exec_cmd()
134134
{
135-
case $EXEC_CMD in
136-
as_install_user) su -s /bin/sh -c 'exec "$0" "$@"' "$INSTALLUSER" -- "$@" ;;
137-
as_current_user) "$@" ;;
135+
case $EXEC_CMD,$(uname -s) in
136+
as_install_user,OpenBSD)
137+
su -s /bin/sh "$INSTALLUSER" -c 'exec "$0" "$@"' "$@"
138+
;;
139+
as_install_user,NetBSD)
140+
su "$INSTALLUSER" -c 'exec "$0" "$@"' -- "$@"
141+
;;
142+
as_install_user,*)
143+
su -s /bin/sh -c 'exec "$0" "$@"' "$INSTALLUSER" -- "$@"
144+
;;
145+
as_current_user,*)
146+
"$@"
147+
;;
138148
esac
139149
}
140150
exec_erl()

0 commit comments

Comments
 (0)