From 4c0b4468554f704633350b0e0cdd4ad174da349b Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Sat, 15 Mar 2025 21:09:26 +0100 Subject: Fix: SunOS' hostname does not know "-f" --- .bash/postexec.bash | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.bash/postexec.bash b/.bash/postexec.bash index 6137814..5164190 100644 --- a/.bash/postexec.bash +++ b/.bash/postexec.bash @@ -1,9 +1,18 @@ declare -x SSH_AUTH_SOCK SSH_AGENT_PID if [ -n "$SSHENVFILE" ] && [ -r "$SSHENVFILE" ];then if source "$SSHENVFILE"; then - if echo "${SSHAGH[@]}"|tr ' ' '\n'|grep -P "^$(hostname -f)$" > /dev/null;then - add-sshagent-init - fi + case "$OSNAME" in + 'sunos') + if echo "${SSHAGH[@]}"|tr ' ' '\n'|grep -E "^$(cat /etc/nodename)\$" + add-sshagent-init + fi + ;; + *) + if echo "${SSHAGH[@]}"|tr ' ' '\n'|grep -P "^$(hostname -f)\$" > /dev/null;then + add-sshagent-init + fi + ;; + esac fi fi for gitpsrc in "/usr/share/git/git-prompt.sh" "/usr/local/share/git/git-prompt.sh" \ -- cgit v1.2.3