11#! /bin/bash
22
3- # define vars
3+ # Define vars
44HESTIA=" /usr/local/hestia"
55HESTIA_BACKUP=" /root/hst_upgrade/$( date +%d%m%Y%H%M) "
66hestiacp=" $HESTIA /install/deb"
@@ -22,10 +22,10 @@ if [ -z "$release_branch_check" ]; then
2222 echo " RELEASE_BRANCH='develop'" >> $HESTIA /conf/hestia.conf
2323fi
2424
25- # load hestia.conf
25+ # Load hestia.conf
2626source $HESTIA /conf/hestia.conf
2727
28- # load hestia main functions
28+ # Load hestia main functions
2929source /usr/local/hestia/func/main.sh
3030
3131# Initialize backup directory
@@ -88,7 +88,7 @@ if [ -f /etc/nginx/nginx.conf ]; then
8888 cp -f $HESTIA /install/deb/nginx/nginx.conf /etc/nginx/nginx.conf
8989fi
9090
91- # Generating dhparam
91+ # Generate dhparam
9292if [ ! -e /etc/ssl/dhparam.pem ]; then
9393 echo " (*) Enabling HTTPS Strict Transport Security (HSTS) support..."
9494 mv /etc/nginx/nginx.conf $HESTIA_BACKUP /conf/
@@ -254,9 +254,12 @@ for ipaddr in $(ls /usr/local/hestia/data/ips/ 2>/dev/null); do
254254done
255255
256256# Cleanup php session files not changed in the last 7 days (60*24*7 minutes)
257- echo ' #!/bin/sh' > /etc/cron.daily/php-session-cleanup
258- echo " find -O3 /home/*/tmp/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
259- chmod 644 /etc/cron.daily/php-session-cleanup
257+ if [ ! -f /etc/cron.daily/php-session-cleanup ]; then
258+ echo ' #!/bin/sh' > /etc/cron.daily/php-session-cleanup
259+ echo " find -O3 /home/*/tmp/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
260+ echo " find -O3 $HESTIA /data/sessions/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
261+ fi
262+ chmod 755 /etc/cron.daily/php-session-cleanup
260263
261264# Fix empty pool error message for MultiPHP
262265php_versions=$( ls /etc/php/* /fpm -d 2> /dev/null | wc -l)
0 commit comments