From: Carsten Leonhardt Date: Thu, 22 Feb 2024 21:43:36 +0000 (+0100) Subject: Cleaner shell code in install-key-manager.sh.in X-Git-Tag: Release-15.0.2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b07a0004be0061bbdb4929aa65e7a3a7a12fd93a;p=thirdparty%2Fbacula.git 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 --- 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"