mirror of
https://github.com/G2-Games/welcome.sh.git
synced 2025-04-19 05:22:53 -05:00
Fixed shell detection, made it more reliable (hopefully)
This commit is contained in:
parent
4c9d4bccc4
commit
a6b5f4ded8
1 changed files with 3 additions and 3 deletions
|
@ -2,12 +2,12 @@ version=0.2.5
|
|||
bashrc="/home/$USER/.bashrc"
|
||||
zshrc="/home/$USER/.zshrc"
|
||||
originaldir=$PWD
|
||||
environment=$(readlink /proc/$$/exe | grep -o 'bash\|zsh')
|
||||
if [[ "$environment" = "bash" ]] || [[ "$environment" = "zsh" ]];
|
||||
environment=$(ps -o args= -p $$ | egrep -m 1 -o '\w{0,5}sh' | head -1)
|
||||
if [ "$environment" = "bash" ] || [ "$environment" = "zsh" ];
|
||||
then
|
||||
if ! grep -q 'bash /home/$USER/.welcome/welcome.sh' $bashrc && ! grep -q 'zsh /home/$USER/.welcome/welcome.sh' $zshrc;
|
||||
then
|
||||
echo "Welcome! Installing..."
|
||||
echo "Welcome! Installing in $environment..."
|
||||
tput sc
|
||||
cd /home/$USER
|
||||
mkdir -p /home/$USER/.welcome
|
||||
|
|
Loading…
Reference in a new issue