Message ID | 20210224133242.30108-1-Quirin.Gylstorff@siemens.com |
---|---|
State | Superseded, archived |
Headers | show |
Series | sshd-regen-keys: do not enable ssh server if previously disabled | expand |
On Wed, 2021-02-24 at 14:32 +0100, [ext] Q. Gylstorff wrote: > From: Quirin Gylstorff <quirin.gylstorff@siemens.com> > > The code 'test -n $SSHD_ENABLED' always returns "0" and enables ssh > even if deactivated previously. > > Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com> > --- > meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh > index 910d879..efcff3e 100644 > --- a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh > +++ b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh > @@ -12,7 +12,7 @@ rm -v /etc/ssh/ssh_host_*_key* > echo "Regenerating keys ..." > dpkg-reconfigure openssh-server > > > > > -if test -n $SSHD_ENABLED; then > +if [-n "$SSHD_ENABLED" ]; then Isn't that a syntax error? - if [-n "$SSHD_ENABLED" ]; then + if [ -n "$SSHD_ENABLED" ]; then > echo "Reenabling ssh server ..." > systemctl enable --no-reload ssh > fi > -- > 2.20.1 >
diff --git a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh index 910d879..efcff3e 100644 --- a/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh +++ b/meta/recipes-support/sshd-regen-keys/files/sshd-regen-keys.sh @@ -12,7 +12,7 @@ rm -v /etc/ssh/ssh_host_*_key* echo "Regenerating keys ..." dpkg-reconfigure openssh-server -if test -n $SSHD_ENABLED; then +if [-n "$SSHD_ENABLED" ]; then echo "Reenabling ssh server ..." systemctl enable --no-reload ssh fi