Skip to content

Commit

Permalink
[CBRD-23834] Change the way to find bash as login shell (#2556)
Browse files Browse the repository at this point in the history
  • Loading branch information
kisoo-han authored Jan 19, 2021
1 parent b31a472 commit b53ae4a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion cmake/CPack.STGZ_Header.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,20 @@ done
# append script for executing .cubrid.sh to .bash_profile
PRODUCT_NAME="CUBRID"
CUBRID_SH_INSTALLED=1
if [ $SHELL = "/bin/bash" ];then
if [ -z "$SHELL" ];then
if [ ! -r /etc/passwd ];then
user_sh="bash"
else
user_name=$(id -nu)
user_sh=$(egrep "^$user_name" /etc/passwd | cut -d':' -f7-7)
user_sh=${user_sh:-none}
user_sh=$(basename $user_sh)
fi
else
user_sh=$(basename $SHELL)
fi

if [ $user_sh = "bash" ];then
sh_profile=$HOME/.bash_profile
append_profile=$(grep "${PRODUCT_NAME} environment" $sh_profile)

Expand Down

0 comments on commit b53ae4a

Please sign in to comment.