* `$_type` does not exist, resulting in empty variable.
  Fixup of 0a4f1ee4d.
* apply issues reported by shellcheck and shfmt
* drop command concatenation for key creation, because why would you want
  to miss out on ed25519 keys if the previous keys couldn't be
  generated?

Signed-off-by: Christian Hermann <[email protected]>
---
 projectroot/etc/rc.once.d/openssh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/projectroot/etc/rc.once.d/openssh 
b/projectroot/etc/rc.once.d/openssh
index 66cfa06df..4a8dd26b0 100644
--- a/projectroot/etc/rc.once.d/openssh
+++ b/projectroot/etc/rc.once.d/openssh
@@ -19,7 +19,7 @@ host_keys_required() {
 
 create_key() {
        keytype="$1"
-       prettykeytype="$(echo $_type | tr a-z A-Z)"
+       prettykeytype="$(echo "$keytype" | tr '[:lower:]' '[:upper:]')"
        shift
        hostkeys="$1"
        shift
@@ -28,8 +28,8 @@ create_key() {
 
        if echo "$hostkeys" | grep -x -F "$file" >/dev/null; then
                echo "Create $prettykeytype key; this may take some time ..."
-               rm -f $file &&
-               ssh-keygen -q -f "$file" -N '' -t "$keytype" "$@" || return
+               rm -f "$file" &&
+                       ssh-keygen -q -f "$file" -N '' -t "$keytype" "$@" || 
return
                echo "Created $prettykeytype key."
        fi
 }
@@ -37,9 +37,9 @@ create_key() {
 create_keys() {
        hostkeys="$(host_keys_required)"
 
-       create_key "dsa" "$hostkeys" &&
-       create_key "ecdsa" "$hostkeys" &&
-       create_key "ed25519" "$hostkeys" &&
+       create_key "dsa" "$hostkeys"
+       create_key "ecdsa" "$hostkeys"
+       create_key "ed25519" "$hostkeys"
        create_key "rsa" "$hostkeys" -b 4096
 }
 
-- 
2.28.0


_______________________________________________
ptxdist mailing list
[email protected]
To unsubscribe, send a mail with subject "unsubscribe" to 
[email protected]

Reply via email to