From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k7vca-0005Px-4Z for ptxdist@pengutronix.de; Tue, 18 Aug 2020 09:01:24 +0200 Received: from mol by dude02.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1k7vcZ-0006d0-SO for ptxdist@pengutronix.de; Tue, 18 Aug 2020 09:01:23 +0200 Date: Tue, 18 Aug 2020 09:01:23 +0200 From: Michael Olbrich Message-ID: <20200818070123.GH8684@pengutronix.de> References: <20200817144624.11812-1-christian.hermann@hytera.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200817144624.11812-1-christian.hermann@hytera.de> Subject: Re: [ptxdist] [PATCH v2] openssh/rc-once: fix minor bug and cleanup List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de On Mon, Aug 17, 2020 at 04:46:24PM +0200, Christian Hermann wrote: > * `$_type` does not exist, resulting in empty variable. > * address 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? > > Fixes: 0a4f1ee4ed231 ("openssh/rc-once: deduplicate some data") > > Signed-off-by: Christian Hermann > --- > 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:]')" As mentioned in my other mail, I've removed this entirely. > 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 This is just indention, right? I'd like to keep it as is. > 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" No. See my other mail. Michael > create_key "rsa" "$hostkeys" -b 4096 > } > > -- > 2.28.0 > > > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de