Skip to content

Commit

Permalink
fixed the "TODO" about showing the full IPv4 address instead of just …
Browse files Browse the repository at this point in the history
…the first octet
  • Loading branch information
terencehonles committed Apr 17, 2012
1 parent d6a97c5 commit 7bb5d4e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bin/sc
@@ -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}"

0 comments on commit 7bb5d4e

Please sign in to comment.