diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-20 18:40:49 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-20 18:40:49 +1200 |
commit | 0ce8aa86a593c19329c96d865a58db89053b130b (patch) | |
tree | a07b28e2b610e232826cbd2c100ec0fd4574699b | |
parent | Exit sshi(1) with 1 not 2 if null SSH_CONNECTION (diff) | |
download | dotfiles-0ce8aa86a593c19329c96d865a58db89053b130b.tar.gz dotfiles-0ce8aa86a593c19329c96d865a58db89053b130b.zip |
Strip trailing period from sshi(1) hostnames
-rwxr-xr-x | bin/sshi | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -17,8 +17,8 @@ printf '%s\n' "$SSH_CONNECTION" "${SSH_TTY:-unknown}" | ( read -r tty # Try to resolve the client and server IPs - ch=$(dig -x "$ci" +short 2>/dev/null | sed 1q) - sh=$(dig -x "$si" +short 2>/dev/null | sed 1q) + ch=$(dig -x "$ci" +short 2>/dev/null | sed 's/\.$//;1q') + sh=$(dig -x "$si" +short 2>/dev/null | sed 's/\.$//;1q') # Print the results in a human-readable format printf "%s:%u -> %s:%u (%s)\n" \ |