refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / ssh-utils / ssh-pubkey.sh
deleted file mode 100644 (file)
index 40b09faa281dedd74d47ef6d870fd0bee9ce958c..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/bash
-set -e
-set -u
-
-function _ssh_pubkey() {
-
-    if [ ! -d "$HOME/.ssh" ]; then
-        mkdir -p "$HOME/.ssh/"
-        chmod 0700 "$HOME/.ssh/"
-    fi
-
-    if [ ! -f "$HOME/.ssh/config" ]; then
-        # for the benefit of VSCode
-        touch "$HOME/.ssh/config"
-        chmod 0644 "$HOME/.ssh/config"
-    fi
-
-    if [ ! -f "$HOME/.ssh/authorized_keys" ]; then
-        touch "$HOME/.ssh/authorized_keys"
-        chmod 0600 "$HOME/.ssh/authorized_keys"
-    fi
-
-    if [ ! -f "$HOME/.ssh/id_rsa" ]; then
-        ssh-keygen -b 2048 -t rsa -f "$HOME/.ssh/id_rsa" -q -N ""
-        echo >&2 ""
-    fi
-
-    if [ ! -f "$HOME/.ssh/id_rsa.pub" ]; then
-        ssh-keygen -y -f "$HOME/.ssh/id_rsa" > "$HOME/.ssh/id_rsa.pub"
-        echo >&2 ""
-    fi
-
-    # TODO use the comment (if any) for the name of the file
-    echo >&2 ""
-    #shellcheck disable=SC2088
-    echo >&2 "~/Downloads/id_rsa.$(whoami).pub":
-    echo >&2 ""
-    rm -f "$HOME/Downloads/id_rsa.$(whoami).pub"
-    cp -r "$HOME/.ssh/id_rsa.pub" "$HOME/Downloads/id_rsa.$(whoami).pub"
-    cat "$HOME/Downloads/id_rsa.$(whoami).pub"
-    echo >&2 ""
-}
-
-_ssh_pubkey
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..45c84e51d4e4a143ecf621b66f6fc2719eac4996
--- /dev/null
@@ -0,0 +1 @@
+../ssh-pubkey/ssh-pubkey.sh
\ No newline at end of file