Skip to content

Commit 79f1d59

Browse files
authored
Updates
Changes find command to better handle directories and files.
1 parent a2affd4 commit 79f1d59

13 files changed

Lines changed: 16 additions & 21 deletions

.github/workflows/enginescript-build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
172172
# Set directory and file permissions
173173
echo "🔧 Setting permissions..." | sudo tee -a /tmp/ci-logs/setup.log
174-
sudo find /usr/local/bin/enginescript -type d,f -exec chmod 755 {} \; 2>&1 | sudo tee -a /tmp/ci-logs/setup.log
174+
sudo find /usr/local/bin/enginescript -exec chmod 755 {} \; 2>&1 | sudo tee -a /tmp/ci-logs/setup.log
175175
sudo chown -R root:root /usr/local/bin/enginescript 2>&1 | sudo tee -a /tmp/ci-logs/setup.log
176176
sudo find /usr/local/bin/enginescript -type f -iname "*.sh" -exec chmod +x {} \; 2>&1 | sudo tee -a /tmp/ci-logs/setup.log
177177
echo "✅ Permissions set correctly" | sudo tee -a /tmp/ci-logs/setup.log

scripts/functions/backup/daily-database-backup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ do
6464
fi
6565

6666
# Remove Old Backups
67-
find "/home/EngineScript/site-backups/$i/database/daily" -type d,f -mtime +30 | xargs rm -fR
68-
find "/home/EngineScript/site-backups/$i/wp-config" -type d,f -mtime +30 | xargs rm -fR
67+
find "/home/EngineScript/site-backups/$i/database/daily" -mtime +30 | xargs rm -fR
68+
find "/home/EngineScript/site-backups/$i/wp-config" -mtime +30 | xargs rm -fR
6969
done

scripts/functions/backup/hourly-database-backup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ do
5656
fi
5757

5858
# Remove Old Backups
59-
find "/home/EngineScript/site-backups/$i/database/hourly" -type d,f -mtime +1 | xargs rm -fR
59+
find "/home/EngineScript/site-backups/$i/database/hourly" -mtime +1 | xargs rm -fR
6060

6161
done

scripts/functions/backup/weekly-wp-content-backup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ do
5555
fi
5656

5757
# Remove Old Backups
58-
find "/home/EngineScript/site-backups/$i/wp-content" -type d,f -mtime +7 | xargs rm -fR
58+
find "/home/EngineScript/site-backups/$i/wp-content" -mtime +7 | xargs rm -fR
5959
done

scripts/functions/cron/permissions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ chmod 770 /run/redis/redis-server.sock 2>/dev/null || true
5858
dos2unix /usr/local/bin/enginescript/*
5959

6060
# Set directory and file permissions to 755
61-
find /usr/local/bin/enginescript -type d,f -exec chmod 755 {} \;
61+
find /usr/local/bin/enginescript -exec chmod 755 {} \;
6262

6363
# Set ownership
6464
chown -R root:root /usr/local/bin/enginescript

scripts/functions/shared/enginescript-common.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,9 @@ function set_nginx_permissions() {
473473
# ----------------------------------------------------------------
474474
# Set permissions for PHP directories and files
475475
function set_php_permissions() {
476-
find "/var/log/php" -type d,f -exec chmod 775 {} \;
477-
find "/var/log/opcache" -type d,f -exec chmod 775 {} \;
478-
find "/etc/php" -type d,f -exec chmod 775 {} \;
476+
find "/var/log/php" -exec chmod 775 {} \;
477+
find "/var/log/opcache" -exec chmod 775 {} \;
478+
find "/etc/php" -exec chmod 775 {} \;
479479
chmod 775 /var/cache/opcache
480480
chmod 775 /var/cache/php-sessions
481481
chmod 775 /var/cache/wsdlcache

scripts/install/depends/depends-install.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,5 @@ apt install -qy $packages || {
169169
# Nano
170170
update-alternatives --set editor /bin/nano
171171

172-
# Cheat.sh
173-
#curl https://cht.sh/:cht.sh | sudo tee /usr/local/bin/cht.sh
174-
#chmod +x /usr/local/bin/cht.sh
175-
176172
# Mark the installation as complete
177173
echo "DEPENDS=1" >> /var/log/EngineScript/install-log.log

scripts/install/enginescript-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dos2unix /home/EngineScript/enginescript-install-options.txt
2727
dos2unix /usr/local/bin/enginescript/*
2828

2929
# Set directory and file permissions to 755
30-
find /usr/local/bin/enginescript -type d,f -exec chmod 755 {} \;
30+
find /usr/local/bin/enginescript -exec chmod 755 {} \;
3131

3232
# Set ownership
3333
chown -R root:root /usr/local/bin/enginescript

scripts/install/kernel/kernel-tweaks-install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env bash
2-
#!/usr/bin/env bash
32
#----------------------------------------------------------------------------------
43
# EngineScript - A High-Performance WordPress Server Built on Ubuntu and Cloudflare
54
#----------------------------------------------------------------------------------

scripts/install/redis/redis-install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ apt install -qy redis redis-server redis-tools
2424
# Setup Redis
2525
#mkdir -p /run/redis
2626
#mkdir -p /var/lib/redis
27-
#mkdir -p /var/log/redis
2827
touch /var/log/redis/redis-server.log
29-
find /var/lib/redis -type d,f -exec chmod 775 {} \;
30-
find /var/lib/redis -type d,f -exec chmod 775 {} \;
28+
find /var/lib/redis -type d -o -type f -exec chmod 775 {} \;
3129
chmod 775 /run/redis
3230
chmod 775 /var/lib/redis
3331
chmod 775 /var/log/redis
@@ -75,6 +73,8 @@ systemctl daemon-reload
7573
restart_service "redis-server"
7674
systemctl enable redis-server
7775

76+
sleep 3
77+
7878
# Ensure correct socket ownership and permissions
7979
chown redis:redis /run/redis/redis-server.sock 2>/dev/null || true
8080
chmod 770 /run/redis/redis-server.sock 2>/dev/null || true

0 commit comments

Comments
 (0)