aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2025-08-27 14:45:33 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2025-08-27 14:45:33 +0300
commit853bb5bdd92cc18dea87f0bd17ef8fc191cf2f18 (patch)
treeaf97ec7222be4503eb733a5bef9d521a076e7385
parent207024b3f41cc770435b78c3c5cdc124e239ddb8 (diff)
downloadswayrice-853bb5bdd92cc18dea87f0bd17ef8fc191cf2f18.tar.gz
swayrice-853bb5bdd92cc18dea87f0bd17ef8fc191cf2f18.zip
sshwiz: script for preparing host for first loginniri
Copies keys and installs terminfo to a remote machine.
-rwxr-xr-xdotfiles/.local/bin/sshwiz18
1 files changed, 18 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/sshwiz b/dotfiles/.local/bin/sshwiz
new file mode 100755
index 0000000..ba71b08
--- /dev/null
+++ b/dotfiles/.local/bin/sshwiz
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# SSH "wizard" script. Copies the public key and installs terminfo for first
+# time use of a host.
+
+if [ -z "$1" ]; then
+ echo "usage: sshwiz <destination>"
+ exit 1
+fi
+
+target=$1
+
+ssh-copy-id $target
+echo "installing terminfo..."
+infocmp $TERM > /tmp/$TERM.terminfo
+rsync /tmp/$TERM.terminfo ${target}:
+ssh $target "tic -x $TERM.terminfo"
+echo "done"