From 0f850bc32604a726634a7f3fb56cdc49258b4fde Mon Sep 17 00:00:00 2001 From: samuel Date: Thu, 25 Jun 2026 19:13:36 +0200 Subject: [PATCH] fix: place commands in if blocks --- netoik-cloud.spec | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/netoik-cloud.spec b/netoik-cloud.spec index 1bc80ff..4c8eb0d 100644 --- a/netoik-cloud.spec +++ b/netoik-cloud.spec @@ -30,6 +30,7 @@ if ! id nextcloud >/dev/null 2>&1; then useradd --base-dir %{_sharedstatedir} --create-home --shell $SHELL --system nextcloud runuser --user=nextcloud -- mkdir --parents %{_sharedstatedir}/nextcloud/data runuser --user=nextcloud -- printf 'alias occ="php /var/www/nextcloud/occ"\n' > %{_sharedstatedir}/nextcloud/.bash_profile + usermod --groups postgres,valkey --append nextcloud fi # Create config file @@ -43,9 +44,6 @@ if ! -f %{_sysconfdir}/nextcloud/config.php; then chmod 640 %{_sysconfdir}/nextcloud/config.php fi -# Add nextcloud to postgres and valkey groups -usermod --groups postgres,valkey --append nextcloud - # Create postgres user and db if ! runuser --user=postgres -- psql --quiet --tuples-only --command='\du' | grep --quiet nextcloud; then runuser --user=postgres -- createuser nextcloud @@ -62,15 +60,11 @@ if ! -d /var/www/nextcloud; then gpg --import %{_tmppath}/nextcloud.asc gpg --verify %{_tmppath}/nextcloud-latest.tar.bz2.asc %{_tmppath}/nextcloud-latest.tar.bz2 tar --extract --file=%{_tmppath}/nextcloud-latest.tar.bz2 --directory=/var/www + chown --recursive nextcloud:nextcloud /var/www/nextcloud + chmod 755 /var/www/nextcloud + runuser --user=nextcloud -- ln --symbolic --force %{_sysconfdir}/nextcloud/config.php /var/www/nextcloud/config/config.php fi -# Change rights and owner -chown --recursive nextcloud:nextcloud /var/www/nextcloud -chmod 755 /var/www/nextcloud - -# Create symbolic link to config -runuser --user=nextcloud -- ln --symbolic --force %{_sysconfdir}/nextcloud/config.php /var/www/nextcloud/config/config.php - # Restart services systemctl daemon-reload systemctl reenable nginx.service php-fpm.service