summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortsxv478 <atvx717@infraredcombat.xyz>2024-06-18 00:32:33 +0300
committertsxv478 <atvx717@infraredcombat.xyz>2024-06-18 00:32:33 +0300
commitbf2572d00832e422635080dc12b8b8ac829e5d23 (patch)
treece213ce29346cbc7ef7d430d4e088f4eff69977a
parent9378b30ce75880dda2148ddd361841e3e91f7964 (diff)
sshmenu script
-rwxr-xr-xsshmenu15
1 files changed, 15 insertions, 0 deletions
diff --git a/sshmenu b/sshmenu
new file mode 100755
index 0000000..4902b10
--- /dev/null
+++ b/sshmenu
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+if [ $DISPLAY ]; then
+ host=$(grep "^Host" $HOME/.ssh/config | cut -d ' ' -f 2 | dmenu -i -c -l 10 -p "SSH to:")
+
+ [ "$host" ] || exit 0
+
+ setsid -f $TERMINAL -e ssh $host -t "tmux new -A"
+else
+ host=$(grep "^Host" $HOME/.ssh/config | cut -d ' ' -f 2 | fzf -e --reverse --prompt "SSH to: ")
+
+ [ "$host" ] || exit 0
+
+ ssh $host -t "tmux new -A"
+fi