From c19ac375e7e94603081b05c46c84238725007d20 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Tue, 20 Sep 2016 13:23:08 -0400 Subject: [PATCH] Added great ssh ip checker --- i3/run.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/i3/run.sh b/i3/run.sh index 7fb0d56..99b046d 100755 --- a/i3/run.sh +++ b/i3/run.sh @@ -70,3 +70,17 @@ fi if [ "$1" = "paste" ]; then DISPLAY=:0.0 xdotool type --clearmodifiers --file <(xsel) fi +if [ "$1" = "ip" ]; then + shift + local RET=0 + if [ "$(hostname)" = "MMLin" ]; then + if grep -q "$1" < <(ifconfig enp2s0f0); then + RET=1 + fi + elif [ "$(hostname)" = "G2" ]; then + if grep -q "$1" < <(ifconfig enp1s0;ifconfig wlp2s0); then + RET=1 + fi + fi + echo $RET +fi