Commit e9ef274b authored by Antonio Huete Jimenez's avatar Antonio Huete Jimenez

Use whoami instead of $USER

- Use whoami instead of relying on the existence of $USER enviroment variable which is not always present
parent db915f7a
...@@ -41,7 +41,7 @@ shell_path="/bin/bash" ...@@ -41,7 +41,7 @@ shell_path="/bin/bash"
test -f /etc/default/gitlab && . /etc/default/gitlab test -f /etc/default/gitlab && . /etc/default/gitlab
# Switch to the app_user if it is not he/she who is running the script. # Switch to the app_user if it is not he/she who is running the script.
if [ "$USER" != "$app_user" ]; then if [ `whoami` != "$app_user" ]; then
eval su - "$app_user" -s $shell_path -c $(echo \")$0 "$@"$(echo \"); exit; eval su - "$app_user" -s $shell_path -c $(echo \")$0 "$@"$(echo \"); exit;
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment