From b07a0004be0061bbdb4929aa65e7a3a7a12fd93a Mon Sep 17 00:00:00 2001 From: Carsten Leonhardt Date: Thu, 22 Feb 2024 22:43:36 +0100 Subject: [PATCH] Cleaner shell code in install-key-manager.sh.in Change deprecated . to : in chown Change bashism "$UID" to POSIX compatible "$(id -u)", c.f. https://www.shellcheck.net/wiki/SC3028 Change "-o" in test to "||", c.f. https://www.shellcheck.net/wiki/SC2166 --- bacula/scripts/install-key-manager.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bacula/scripts/install-key-manager.sh.in b/bacula/scripts/install-key-manager.sh.in index b35c16594..bf4d31bc8 100644 --- a/bacula/scripts/install-key-manager.sh.in +++ b/bacula/scripts/install-key-manager.sh.in @@ -136,9 +136,9 @@ uid=bacula@localhost passphrase=$PASSPHRASE stealth=off EOF - if [ "$USER" = root -o "$UID" = 0 ]; then + if [ "$USER" = root ] || [ "$(id -u)" = 0 ]; then echo change ownership to user bacula - chown -R bacula.bacula $KEYMAN_CONF $GNUPGHOME + chown -R bacula:bacula $KEYMAN_CONF $GNUPGHOME fi echo "public and private keys have been created in $GNUPGHOME" echo "the key-manager configuration file is in $KEYMAN_CONF" -- 2.47.3