From 54c1158aff8b987dea88b35597047fafe92cd0a7 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 14 Dec 2023 13:41:54 -0300 Subject: Fix: chown invocations --- lib/hydra/deploy | 2 +- share/hydra/deploy | 2 +- share/hydra/import-certs | 8 ++++---- share/hydra/import-keys | 12 ++++++------ share/hydractl/backup-restore-bitcoind | 2 +- share/hydractl/backup-restore-firma | 2 +- share/hydractl/backup-restore-git | 2 +- share/hydractl/backup-restore-hidden | 2 +- share/hydractl/backup-restore-mail | 2 +- share/hydractl/backup-restore-mlmmj | 2 +- share/hydractl/backup-restore-munin | 2 +- share/hydractl/backup-restore-schleuder | 2 +- share/hydractl/backup-restore-site | 20 ++++++++++---------- share/hydractl/backup-restore-svn | 4 ++-- share/hydractl/backup-restore-sympa | 2 +- share/hydractl/backup-restore-tahoe | 2 +- share/hydractl/backup-restore-yacy | 2 +- share/hydractl/backup-site | 6 +++--- share/hydractl/sync-guestfs | 2 +- share/hydractl/sync-media | 8 ++++---- share/hydractl/sync-tpc | 2 +- 21 files changed, 44 insertions(+), 44 deletions(-) diff --git a/lib/hydra/deploy b/lib/hydra/deploy index 84a9fda..6990339 100644 --- a/lib/hydra/deploy +++ b/lib/hydra/deploy @@ -140,7 +140,7 @@ function hydra_yaml_param { function hydra_deploy_mkdirs { # Saner defaults $DEPLOY_COMMAND mkdir -p /etc/puppet/keys - $DEPLOY_COMMAND chown -R root. /etc/puppet + $DEPLOY_COMMAND chown -R root: /etc/puppet $DEPLOY_COMMAND chmod -R 640 /etc/puppet } diff --git a/share/hydra/deploy b/share/hydra/deploy index af3d0a2..b675577 100755 --- a/share/hydra/deploy +++ b/share/hydra/deploy @@ -149,7 +149,7 @@ for node in $NODES; do tee $HYDRA_FOLDER/puppet/logs/$FQDN.`date +%Y%m%d%H%M`.log # Fix ssl folder ownership - $SUDO chown -R `whoami`. $HYDRA_FOLDER/puppet/ssl + $SUDO chown -R `whoami`: $HYDRA_FOLDER/puppet/ssl # Import keys if needed if ! $SUDO test -f /root/.ssh/id_rsa || \ diff --git a/share/hydra/import-certs b/share/hydra/import-certs index 9d3cc88..e1ceda6 100755 --- a/share/hydra/import-certs +++ b/share/hydra/import-certs @@ -48,8 +48,8 @@ for node in $NODES; do $HYDRA_CONNECT $hostname < $PACK.md5 sha1sum $PACK > $PACK.sha1 - chown root.$BACKUPS_GROUP $PACK* + chown root:$BACKUPS_GROUP $PACK* chmod 640 $PACK* echo "Saved $DEST/$PACK" fi @@ -127,7 +127,7 @@ if [ -d "/var/lib/mysql/$DATABASE" ]; then rm -f $DATABASE.sql md5sum $DATABASE.sql.bz2 > $DATABASE.sql.bz2.md5 sha1sum $DATABASE.sql.bz2 > $DATABASE.sql.bz2.sha1 - chown root.$BACKUPS_GROUP $DATABASE.sql* + chown root:$BACKUPS_GROUP $DATABASE.sql* chmod 640 $DATABASE.sql* echo "Saved $DEST/$DATABASE.sql.bz2" fi diff --git a/share/hydractl/sync-guestfs b/share/hydractl/sync-guestfs index dce2f2b..c2852e1 100755 --- a/share/hydractl/sync-guestfs +++ b/share/hydractl/sync-guestfs @@ -40,7 +40,7 @@ if [ ! -d "$DEST" ]; then GROUP="$(stat -c %G $ORIG)" # With the right permissions - $SUDO chown $OWNER.$GROUP $DEST + $SUDO chown $OWNER:$GROUP $DEST fi # First sync the folder structure diff --git a/share/hydractl/sync-media b/share/hydractl/sync-media index f3cd973..bf95678 100755 --- a/share/hydractl/sync-media +++ b/share/hydractl/sync-media @@ -75,7 +75,7 @@ function sync_media_add_metadata { function sync_media_playlist_perms { if [ -d "playlists" ]; then $sudo chmod 775 playlists - $sudo chown -R mpd.audio playlists + $sudo chown -R mpd:audio playlists find playlists -type f -exec sudo chmod 664 {} \; find playlists -type d -exec sudo chmod 775 {} \; fi @@ -87,7 +87,7 @@ function sync_media_incoming_perms { echo "Fixing $INCOMING permissions..." $sudo find $INCOMING -type f -exec chmod 664 {} \; $sudo find $INCOMING -type d -exec chmod 775 {} \; - $sudo chown -R $WHOAMI.incoming $INCOMING + $sudo chown -R $WHOAMI:incoming $INCOMING fi } @@ -187,8 +187,8 @@ mkdir -p $CACHE #echo "Fixing $CACHE permissions..." #$sudo find $CACHE -type f -exec chmod 644 {} \; #$sudo find $CACHE -type d -exec chmod 755 {} \; -$sudo chown $WHOAMI. $CACHE -$sudo chown $WHOAMI. $CACHE/* +$sudo chown $WHOAMI: $CACHE +$sudo chown $WHOAMI: $CACHE/* # Check if a specific repository was passed via the command line if [ ! -z "$REPOSITORY" ] && [ -d "$CACHE/$REPOSITORY" ] && ! echo "$REPOSITORY" | grep -q -- '--'; then diff --git a/share/hydractl/sync-tpc b/share/hydractl/sync-tpc index 0c8b177..c739c5a 100755 --- a/share/hydractl/sync-tpc +++ b/share/hydractl/sync-tpc @@ -69,7 +69,7 @@ if [ ! -d "$MEDIA" ]; then GROUP="$(stat -c %G /var/cache/`hostname -s`/media)" # With the right permissions - $SUDO chown $OWNER.$GROUP $MEDIA + $SUDO chown $OWNER:$GROUP $MEDIA fi # Guest images were previously synced using rsync -- cgit v1.2.3