From 705a4d60f230d06f5298a70851a2d42ae97be97b Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Sat, 15 Mar 2025 21:21:45 +0100 Subject: Fix: more SunOS incompatibilities --- .bash/exec.bash | 15 ++++++++++++++- .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() { -- cgit v1.2.3