Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed the "TODO" about showing the full IPv4 address instead of just …
…the first octet
- Loading branch information
1 parent
d6a97c5
commit 7bb5d4e
Showing
1 changed file
with
3 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,13 +1,12 @@ | |||
#!/bin/sh | #!/bin/bash | ||
# Wrapper to start tmux sessions for connections to hosts | # Wrapper to start tmux sessions for connections to hosts | ||
|
|
||
# This is a security test I like to perform - we want to show what | # This is a security test I like to perform - we want to show what | ||
# ssh binary is being used to prevent any trickery | # ssh binary is being used to prevent any trickery | ||
WHICH_SSH=`which ssh` | WHICH_SSH=`which ssh` | ||
|
|
||
# Show only the start of the hostname. | # Show only the IPv4 address or the start of the hostname. | ||
# TODO: Make this work better with IP addresses (only shows first octet) | HOST=`grep -o '^\([0-9]\+\.\)\{3\}[0-9]\+\|^[^.]\+' <<<"${1}"` | ||
HOST=`echo $1|cut -d. -f1` | |||
|
|
||
# Start tmux window | # Start tmux window | ||
tmux new-window -n ${HOST} "echo 'Using: $WHICH_SSH' ; ~/bin/sc-ssh ${1}" | tmux new-window -n ${HOST} "echo 'Using: $WHICH_SSH' ; ~/bin/sc-ssh ${1}" |