Skip to content

Commit e9ef274

Browse files
committed
Use whoami instead of $USER
- Use whoami instead of relying on the existence of $USER enviroment variable which is not always present
1 parent db915f7 commit e9ef274

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/support/init.d/gitlab

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ shell_path="/bin/bash"
4141
test -f /etc/default/gitlab && . /etc/default/gitlab
4242

4343
# Switch to the app_user if it is not he/she who is running the script.
44-
if [ "$USER" != "$app_user" ]; then
44+
if [ `whoami` != "$app_user" ]; then
4545
eval su - "$app_user" -s $shell_path -c $(echo \")$0 "$@"$(echo \"); exit;
4646
fi
4747

0 commit comments

Comments
 (0)