install_roundcube.sh: fix error creating logrotae definitions.
This commit is contained in:
parent
7775ae21c6
commit
0885824946
@ -186,6 +186,7 @@ DEFAULT_MYSQL_CREDENTIALS="--defaults-file=/usr/local/mysql/sys-maint.cnf"
|
|||||||
TLD=${WEBSITE_NAME##*.}
|
TLD=${WEBSITE_NAME##*.}
|
||||||
_tmp_string=${WEBSITE_NAME%.*}
|
_tmp_string=${WEBSITE_NAME%.*}
|
||||||
MAIN_DOMAIN=${_tmp_string##*.}
|
MAIN_DOMAIN=${_tmp_string##*.}
|
||||||
|
HOSTNAME_SHORT=${_tmp_string%%.*}
|
||||||
|
|
||||||
[[ -n "$WEBMASTER_EMAIL" ]] || WEBMASTER_EMAIL="admin@${MAIN_DOMAIN}.$TLD"
|
[[ -n "$WEBMASTER_EMAIL" ]] || WEBMASTER_EMAIL="admin@${MAIN_DOMAIN}.$TLD"
|
||||||
|
|
||||||
@ -1540,11 +1541,7 @@ fi
|
|||||||
# - Logrotate logfiles from webmailer, locatet at $WEBSITE_BASEDIR/logs
|
# - Logrotate logfiles from webmailer, locatet at $WEBSITE_BASEDIR/logs
|
||||||
# -
|
# -
|
||||||
echononl "\tCreate logrotate entry.."
|
echononl "\tCreate logrotate entry.."
|
||||||
if [[ "$PHP_TYPE" = "fcgid" ]] ; then
|
cat <<EOF > /etc/logrotate.d/roundcube-${HOSTNAME_SHORT} 2> $log_file
|
||||||
cat <<EOF > /etc/logrotate.d/roundcube 2> $log_file
|
|
||||||
$WEBSITE_BASEDIR/logs/errors
|
|
||||||
$WEBSITE_BASEDIR/logs/sql
|
|
||||||
$WEBSITE_BASEDIR/logs/sendmail
|
|
||||||
$WEBSITE_BASEDIR/logs/*.log {
|
$WEBSITE_BASEDIR/logs/*.log {
|
||||||
daily
|
daily
|
||||||
start 0
|
start 0
|
||||||
@ -1555,6 +1552,13 @@ $WEBSITE_BASEDIR/logs/*.log {
|
|||||||
delaycompress
|
delaycompress
|
||||||
create 640 www-data www-data
|
create 640 www-data www-data
|
||||||
copytruncate
|
copytruncate
|
||||||
|
postrotate
|
||||||
|
# Maybe apache2 logrotating sets wron file permissions..
|
||||||
|
#
|
||||||
|
if ls /var/www/${WEBSITE_BASEDIR}/logs/*.log > /dev/null 2>&1 ; then
|
||||||
|
chown www-data:www-data /var/www/${WEBSITE_BASEDIR}/logs/*.log
|
||||||
|
fi
|
||||||
|
endscript
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
@ -1563,29 +1567,6 @@ EOF
|
|||||||
echo_failed
|
echo_failed
|
||||||
error "$(cat $log_file)"
|
error "$(cat $log_file)"
|
||||||
fi
|
fi
|
||||||
elif [[ "$APACHE_LOG_DIR" =~ ${WEBSITE_BASEDIR} ]] ; then
|
|
||||||
cat <<EOF > /etc/logrotate.d/roundcube 2> $log_file
|
|
||||||
$APACHE_LOG_DIR/*.log {
|
|
||||||
daily
|
|
||||||
start 0
|
|
||||||
rotate 7
|
|
||||||
missingok
|
|
||||||
notifempty
|
|
||||||
compress
|
|
||||||
delaycompress
|
|
||||||
create 640 www-data www-data
|
|
||||||
copytruncate
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
echo_ok
|
|
||||||
else
|
|
||||||
echo_failed
|
|
||||||
error "$(cat $log_file)"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo_skipped
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
echo -e "\n\n\t\033[37m\033[1mSetup Database '$DB_TYPE'..\033[m\n"
|
echo -e "\n\n\t\033[37m\033[1mSetup Database '$DB_TYPE'..\033[m\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user