bugfix(misc): fix kind, gprox, myip, pandoc
[webi-installers/.git] / ssh-utils / ssh-pubkey.sh
index ed5c345aaa91b472414338ea12ecd1d482b15308..40b09faa281dedd74d47ef6d870fd0bee9ce958c 100644 (file)
@@ -1,8 +1,8 @@
 #!/bin/bash
+set -e
+set -u
 
-{
-    set -e
-    set -u
+function _ssh_pubkey() {
 
     if [ ! -d "$HOME/.ssh" ]; then
         mkdir -p "$HOME/.ssh/"
 
     if [ ! -f "$HOME/.ssh/id_rsa" ]; then
         ssh-keygen -b 2048 -t rsa -f "$HOME/.ssh/id_rsa" -q -N ""
-        >&2 echo ""
+        echo >&2 ""
     fi
 
     if [ ! -f "$HOME/.ssh/id_rsa.pub" ]; then
         ssh-keygen -y -f "$HOME/.ssh/id_rsa" > "$HOME/.ssh/id_rsa.pub"
-        >&2 echo ""
+        echo >&2 ""
     fi
 
     # TODO use the comment (if any) for the name of the file
-    >&2 echo ""
-    >&2 echo "~/Downloads/id_rsa.$(whoami).pub":
-    >&2 echo ""
+    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"
-    >&2 echo ""
+    echo >&2 ""
 }
+
+_ssh_pubkey