Update UPDATE.sh

This commit is contained in:
Stefan Pejcic 2025-04-08 15:18:40 +02:00 committed by GitHub
parent ddf6288be2
commit cbacd42a6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,3 +3,26 @@
wget -O /etc/openpanel/wordpress/wp-cli.phar https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar wget -O /etc/openpanel/wordpress/wp-cli.phar https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x /etc/openpanel/wordpress/wp-cli.phar chmod +x /etc/openpanel/wordpress/wp-cli.phar
INSERT_TEXT="user root;"
for dir in /home/*; do
file="$dir/nginx.conf"
user=$(basename "$dir")
if [[ -f "$file" ]]; then
if ! grep -q "$INSERT_TEXT" "$file"; then
sed -i "/worker_rlimit_nofile 65535;/a \\
$INSERT_TEXT" "$file"
echo "Updated: $file"
if docker --context "$user" ps --format '{{.Names}}' | grep "nginx"; then
cd /home/"$user"
docker --context "$user" compose down nginx
docker --context "$user" compose up -d nginx
echo "Nginx restarted for user: $user"
fi
fi
fi
done