git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormail_redacted_for_web 2025-03-15 21:09:26 +0100
committermail_redacted_for_web 2025-03-15 21:09:26 +0100
commit4c0b4468554f704633350b0e0cdd4ad174da349b (patch)
tree744e2e8468c2f1ef9971cb2060ea71a837b64122
parent63db89c4a32cab3164c8a3871f7489ec0e68e7a3 (diff)
downloaddotfiles-4c0b4468554f704633350b0e0cdd4ad174da349b.tar.bz2
Fix: SunOS' hostname does not know "-f"
-rw-r--r--.bash/postexec.bash15
1 files 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" \