diff --git a/roles/home-cli/files/bash_profile b/roles/home-cli/files/bash_profile index 48fa744..ba5adab 100644 --- a/roles/home-cli/files/bash_profile +++ b/roles/home-cli/files/bash_profile @@ -6,7 +6,14 @@ fi export BASH_ENV="$HOME/.bashrc" +export _acp_ignore_shrc=1 if [ -r "$HOME/.profile" ] then . "$HOME/.profile" fi +unset _acp_ignore_shrc + +if [ -r "$HOME/.bashrc" ] +then + . "$HOME/.bashrc" +fi diff --git a/roles/home-cli/files/bashrc b/roles/home-cli/files/bashrc index 3a7ae4a..6de9abe 100644 --- a/roles/home-cli/files/bashrc +++ b/roles/home-cli/files/bashrc @@ -1,4 +1,13 @@ #!/bin/bash +case "$-" in +*i*) + ;; +*) + # Shell is not interactive. + return 1 + ;; +esac + if [ -f /etc/bashrc ] then . /etc/bashrc diff --git a/roles/home-cli/files/shrc b/roles/home-cli/files/shrc index 5f242c6..6e9227b 100644 --- a/roles/home-cli/files/shrc +++ b/roles/home-cli/files/shrc @@ -1,4 +1,18 @@ #!/bin/sh +if [ -n "$_acp_ignore_shrc" ] +then + return 1 +fi + +case "$-" in +*i*) + ;; +*) + # Shell is not interactive. + return 1 + ;; +esac + if [ -d /var/acp ] then export ACP=/var/acp @@ -294,11 +308,4 @@ tlscheck () { fi } -case "$-" in -*i*) - # Shell is interactive - usermotd - ;; -*) - ;; -esac +usermotd diff --git a/roles/home-cli/files/zprofile b/roles/home-cli/files/zprofile index 80038c0..b1ea3c5 100644 --- a/roles/home-cli/files/zprofile +++ b/roles/home-cli/files/zprofile @@ -4,7 +4,14 @@ then . /etc/zprofile fi -if [ -e $HOME/.profile ] +export _acp_ignore_shrc=1 +if [ -r "$HOME/.profile" ] then - emulate sh -c ". $HOME/.profile" + emulate sh -c '. "$HOME/.profile"' +fi +unset _acp_ignore_shrc + +if [ -r "$HOME/.zshrc" ] +then + . "$HOME/.zshrc" fi diff --git a/roles/home-cli/files/zshrc b/roles/home-cli/files/zshrc index 7772c80..872b2a2 100644 --- a/roles/home-cli/files/zshrc +++ b/roles/home-cli/files/zshrc @@ -1,4 +1,13 @@ #!/bin/zsh +case "$-" in +*i*) + ;; +*) + # Shell is not interactive. + return 1 + ;; +esac + if [ -f /etc/zshrc ] then . /etc/zshrc