File tree Expand file tree Collapse file tree 7 files changed +23
-15
lines changed
Expand file tree Collapse file tree 7 files changed +23
-15
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ get_user_ip
4141# Verifications #
4242# ----------------------------------------------------------#
4343
44- check_args ' 3 ' " $# " ' USER DOMAIN [RESTART]'
44+ check_args ' 2 ' " $# " ' USER DOMAIN [RESTART]'
4545is_format_valid ' user' ' domain'
4646is_system_enabled " $MAIL_SYSTEM " ' MAIL_SYSTEM'
4747is_system_enabled " $WEB_SYSTEM " ' WEB_SYSTEM'
Original file line number Diff line number Diff line change 88# Variable&Function #
99# ----------------------------------------------------------#
1010
11+ # Argument definition
12+ user=$1
13+ domain=$2
14+
1115# Includes
1216source $HESTIA /func/main.sh
1317source $HESTIA /func/domain.sh
1418source $HESTIA /conf/hestia.conf
1519
16- # Argument definition
17- user=$1
18- domain=$2
19-
2020# Additional argument formatting
2121format_domain
2222format_domain_idn
Original file line number Diff line number Diff line change 4141cp -rf $HESTIA /install/$type /templates/web $HESTIA /data/templates/
4242
4343# Update Multiphp templates
44- php_versions=$( ls -l /etc/php/ | grep ^ d | wc -l )
44+ php_versions=$( ls /etc/php/* /fpm - d | wc -l)
4545if [ " $php_versions " -gt 1 ]; then
4646 if [ " $WEB_SYSTEM " = " nginx" ]; then
4747 for tplname in $( ls $HESTIA /data/templates/web/$WEB_SYSTEM / | grep -v ' default' ) ; do
4848 rm -fr $HESTIA /data/templates/web/$WEB_SYSTEM /$tplname
4949 done
5050 fi
5151 for v in $( ls /etc/php/) ; do
52+ if [ ! -d " /etc/php/$v /fpm/pool.d/" ]; then
53+ continue
54+ fi
5255 v_tpl=$( echo " $v " | sed -e ' s/[.]//' )
5356 cp -f $HESTIA /install/$type /multiphp/$WEB_SYSTEM /PHP-$v_tpl .* $HESTIA /data/templates/web/$WEB_SYSTEM /
5457 done
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ server {
1919 location / {
2020 try_files $uri $uri/ /index.php?$args;
2121 location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
22- alias /var/lib/roundcube/;
2322 expires 1h;
2423 fastcgi_hide_header "Set-Cookie";
2524 }
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ server {
1919 location / {
2020 try_files $uri $uri / /index.php?$args ;
2121 location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
22- alias /var/lib/roundcube/;
2322 expires 1h;
2423 fastcgi_hide_header " Set-Cookie" ;
2524 }
Original file line number Diff line number Diff line change @@ -145,9 +145,13 @@ chmod 751 $HESTIA/data/templates/web/unassigned/js
145145chmod 751 $HESTIA /data/templates/web/unassigned/webfonts
146146
147147# Correct other permissions
148- chown bind:bind /var/cache/bind
149- chmod 640 /etc/roundcube/debian-db*
150- chown root:www-data /etc/roundcube/debian-db*
148+ if [ -d " /var/cache/bind" ]; then
149+ chown bind:bind /var/cache/bind
150+ fi
151+ if [ -d " /etc/roundcube" ]; then
152+ chmod 640 /etc/roundcube/debian-db*
153+ chown root:www-data /etc/roundcube/debian-db*
154+ fi
151155
152156# Add unassigned hosts configuration to Nginx and Apache
153157if [ " $WEB_SYSTEM " = " apache2" ]; then
@@ -174,9 +178,12 @@ if [ "$PROXY_SYSTEM" = "nginx" ]; then
174178fi
175179
176180# Fix empty pool error message for MultiPHP
177- php_versions=$( ls -l /etc/php/ | grep ^ d | wc -l )
181+ php_versions=$( ls /etc/php/* /fpm - d | wc -l)
178182if [ " $php_versions " -gt 1 ]; then
179183 for v in $( ls /etc/php/) ; do
184+ if [ ! -d " /etc/php/$v /fpm/pool.d/" ]; then
185+ continue
186+ fi
180187 cp -f $hestiacp /php-fpm/dummy.conf /etc/php/$v /fpm/pool.d/
181188 v1=$( echo " $v " | sed -e ' s/[.]//' )
182189 sed -i " s/9999/99$v1 /g" /etc/php/$v /fpm/pool.d/dummy.conf
Original file line number Diff line number Diff line change 154154
155155 // Add antivirs
156156 if (($ v_antivirus == 'no ' ) && (!empty ($ _POST ['v_antivirus ' ])) && (empty ($ _SESSION ['error_msg ' ]))) {
157- exec (HESTIA_CMD ."v-add-mail-domain-antivirus " .$ v_username ." " .$ escapeshellarg ($ v_domain ), $ output , $ return_var );
157+ exec (HESTIA_CMD ."v-add-mail-domain-antivirus " .$ v_username ." " .escapeshellarg ($ v_domain ), $ output , $ return_var );
158158 check_return_code ($ return_var ,$ output );
159159 $ v_antivirus = 'yes ' ;
160160 unset($ output );
161161 }
162162
163163 // Delete DKIM
164164 if (($ v_dkim == 'yes ' ) && (empty ($ _POST ['v_dkim ' ])) && (empty ($ _SESSION ['error_msg ' ]))) {
165- exec (HESTIA_CMD ."v-delete-mail-domain-dkim " .$ v_username ." " .$ escapeshellarg ($ v_domain ), $ output , $ return_var );
165+ exec (HESTIA_CMD ."v-delete-mail-domain-dkim " .$ v_username ." " .escapeshellarg ($ v_domain ), $ output , $ return_var );
166166 check_return_code ($ return_var ,$ output );
167167 $ v_dkim = 'no ' ;
168168 unset($ output );
169169 }
170170
171171 // Add DKIM
172172 if (($ v_dkim == 'no ' ) && (!empty ($ _POST ['v_dkim ' ])) && (empty ($ _SESSION ['error_msg ' ]))) {
173- exec (HESTIA_CMD ."v-add-mail-domain-dkim " .$ v_username ." " .$ escapeshellarg ($ v_domain ), $ output , $ return_var );
173+ exec (HESTIA_CMD ."v-add-mail-domain-dkim " .$ v_username ." " .escapeshellarg ($ v_domain ), $ output , $ return_var );
174174 check_return_code ($ return_var ,$ output );
175175 $ v_dkim = 'yes ' ;
176176 unset($ output );
You can’t perform that action at this time.
0 commit comments