Browse code

Add dotfiles

Robert Cranston authored on 13/02/2022 02:08:04
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,19 @@
1
+# https://man.openbsd.org/ssh#SSH_CONNECTION
2
+__prompt_user_host="$(
3
+  if [ "$(id -u)" != "1000" ]
4
+  then
5
+    printf '%s' "$(id -un)"
6
+  fi
7
+  if [ "$SSH_CONNECTION" != "" ]
8
+  then
9
+    printf '@%s' "$(hostname)"
10
+  fi
11
+)"
12
+
13
+__prompt_user_host()
14
+{
15
+  if [ "$__prompt_user_host" ]
16
+  then
17
+    printf "$1" "$__prompt_user_host"
18
+  fi
19
+}