diff options
author | mail_redacted_for_web | 2025-03-15 21:21:45 +0100 |
---|---|---|
committer | mail_redacted_for_web | 2025-03-15 21:21:45 +0100 |
commit | 705a4d60f230d06f5298a70851a2d42ae97be97b (patch) | |
tree | d82a528d3981594cc92582a519391a6d4197e1d4 | |
parent | e334235dc8247ae0cff5626b1c83f0cca85a36a7 (diff) | |
download | dotfiles-705a4d60f230d06f5298a70851a2d42ae97be97b.tar.bz2 |
Fix: more SunOS incompatibilities
-rw-r--r-- | .bash/exec.bash | 15 | ||||
-rw-r--r-- | .bash/prompt.bash | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/.bash/exec.bash b/.bash/exec.bash index 713e1ab..aeba7ca 100644 --- a/.bash/exec.bash +++ b/.bash/exec.bash @@ -7,7 +7,20 @@ set bell-style visible # start ssh agent. this script will not try to run a new instance # (unless we specified -f, which we don't). -if echo "${SSHAGH[@]}" | grep -F --word-regexp "$(hostname -f)" > /dev/null;then +SSHRUN=0 +case "$OSNAME" in + 'sunos') + if echo "${SSHAGH[@]}" | grep -E "^$(cat /etc/nodename)\$" > /dev/null; then + SSHRUN=1 + fi + ;; + *) + if echo "${SSHAGH[@]}" | grep -F --word-regexp "$(hostname -f)" > /dev/null;then + SSHRUN=1 + fi + ;; +esac +if [ "$SSHRUN" -eq 1 ]; then # do not launch from SSH session, conflicts with user logging on locally afterwards if [ -z "$SSH_TTY" ];then "$HOME/bin/ssh-agent-launcher" -q diff --git a/.bash/prompt.bash b/.bash/prompt.bash index 956b3b9..c54e8dc 100644 --- a/.bash/prompt.bash +++ b/.bash/prompt.bash @@ -141,7 +141,7 @@ fi UHSEP="@" [ -n "$TMUX_PANE" ]&&UHSEP="[T]" [ -n "$BYOBU_WINDOW_NAME" ]&&UHSEP="[B]" -[ "$(hostname -s)" == "monitoring" ]&&PHN="$(hostname -f)"||PHN="$(hostname -s)" +[ "$OSNAME" != 'sunos' ]&&[ "$(hostname -s)" == "monitoring" ]&&PHN="$(hostname -f)"||PHN="$(hostname -s)" # ----- ASSEMBLE THE PROMPT COMMAND ADDITION ----- # __prompt_command() { |