diff --git a/.bashrc b/.bashrc index e650c75649888b5ee57345e179453ee21756bd9f..9636151c2abaa001b17d5495888b48539e00bafe 100644 --- a/.bashrc +++ b/.bashrc @@ -71,7 +71,6 @@ alias kpcli='kpcli --kdb ~/Documents/Database.kdbx' alias gen-mac="hexdump -n5 -e '\"02\" 5/1 \":%02X\" \"\\n\"' /dev/urandom" alias clean-swp="find \$HOME/ -name '*.swp' -delete" alias unssh="ssh -o \"UserKnownHostsFile /dev/null\" -o \"StrictHostKeyChecking no\"" -alias boxssh="unssh -i \$HOME/.ssh/bullguard-box_rsa -l root -p 64222" alias todo="vim \$HOME/Documents/TODO.yml" alias sudo="sudo " alias presentation='docker run -itv "$PWD:/project" adarnimrod/presentation' diff --git a/Documents/bin/boxssh b/Documents/bin/boxssh new file mode 100755 index 0000000000000000000000000000000000000000..9f89d93f9ba93221ecae4e4b59afd0f2dca910d3 --- /dev/null +++ b/Documents/bin/boxssh @@ -0,0 +1,15 @@ +#!/bin/sh +set -eu + +die () { + echo "$@" + exit 1 +} + +which ip > /dev/null || die "Can't find ip." +alias ssh='ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i "$HOME/.ssh/bullguard-box_rsa" -l root -p 64222' + + +gateway="$(ip neigh show | awk '$5 ~ /^38:b8:eb:5/ {print $1}')" +[ -n "$gateway" ] || die "Can't find Dojo box IP." +ssh "$gateway"