Fix errors accesseing Mysql database for installation/upgrading roundcube webmailer.

This commit is contained in:
Christoph 2017-11-05 04:39:08 +01:00
parent 6afef61382
commit a53d252d69
2 changed files with 23 additions and 9 deletions

View File

@ -624,6 +624,20 @@ else
fi fi
echononl "\tChange ownership of ${HTTP_USER}'s home directory"
if [[ "$(stat -c "%U" "/var/www")" != "$HTTP_USER" ]]; then
chown $HTTP_USER:${HTTP_GROUP} "/var/www" > $log_file 2>&1
if [[ "$?" = "0" ]]; then
echo_ok
else
echo_failed
error "$(cat $log_file)"
fi
else
echo_skipped
fi
echononl "\tInstall PHP dependencies.." echononl "\tInstall PHP dependencies.."
#/usr/local/php-${php_latest_ver}/bin/php /usr/local/bin/composer install --no-dev #/usr/local/php-${php_latest_ver}/bin/php /usr/local/bin/composer install --no-dev
su www-data -c"cd ${WEBSITE_BASEDIR}/roundcubemail-${ROUNDCUBE_VERSION} su www-data -c"cd ${WEBSITE_BASEDIR}/roundcubemail-${ROUNDCUBE_VERSION}
@ -1816,7 +1830,7 @@ echononl "\tBackup existing Database '$DB_NAME'"
if $database_exists ; then if $database_exists ; then
if [[ "$DB_TYPE" = "mysql" ]]; then if [[ "$DB_TYPE" = "mysql" ]]; then
echo -n " (MySQL).." echo -n " (MySQL).."
mysqldump -u$_mysql_rootuser -p$_mysql_rootpass --opt $DB_NAME > ${WEBSITE_BASEDIR}/${DB_NAME}.$backup_date 2> $log_file mysqldump $MYSQL_CREDENTIALS --opt $DB_NAME > ${WEBSITE_BASEDIR}/${DB_NAME}.$backup_date 2> $log_file
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
echo_ok echo_ok
else else
@ -2165,7 +2179,7 @@ else
echo_failed echo_failed
error "$(cat $log_file)" error "$(cat $log_file)"
fi fi
echononl "\tCeate Symlink '$_pligin' in plugin folder.." echononl "\tCeate Symlink '$_plugin' in plugin folder.."
ln -s Roundcube-Plugin-Context-Menu-master \ ln -s Roundcube-Plugin-Context-Menu-master \
${WEBSITE_BASEDIR}/roundcubemail-${ROUNDCUBE_VERSION}/plugins/${_plugin} > $log_file 2>&1 ${WEBSITE_BASEDIR}/roundcubemail-${ROUNDCUBE_VERSION}/plugins/${_plugin} > $log_file 2>&1
if [[ $? -eq 0 ]] ; then if [[ $? -eq 0 ]] ; then
@ -2221,7 +2235,7 @@ else
error "$(cat $log_file)" error "$(cat $log_file)"
fi fi
echononl "\tCeate Symlink '$_pligin' in plugin folder.." echononl "\tCeate Symlink '$_plugin' in plugin folder.."
ln -s roundcube-login-language-master \ ln -s roundcube-login-language-master \
${WEBSITE_BASEDIR}/roundcubemail-${ROUNDCUBE_VERSION}/plugins/${_plugin} > $log_file 2>&1 ${WEBSITE_BASEDIR}/roundcubemail-${ROUNDCUBE_VERSION}/plugins/${_plugin} > $log_file 2>&1
if [[ $? -eq 0 ]] ; then if [[ $? -eq 0 ]] ; then
@ -2334,7 +2348,7 @@ else
echo_failed echo_failed
error "$(cat $log_file)" error "$(cat $log_file)"
fi fi
echononl "\tCeate Symlink '$_pligin' in plugin folder.." echononl "\tCeate Symlink '$_plugin' in plugin folder.."
ln -s Roundcube-Plugin-Mark-as-Junk-2-master \ ln -s Roundcube-Plugin-Mark-as-Junk-2-master \
${WEBSITE_BASEDIR}/roundcubemail-${ROUNDCUBE_VERSION}/plugins/${_plugin} > $log_file 2>&1 ${WEBSITE_BASEDIR}/roundcubemail-${ROUNDCUBE_VERSION}/plugins/${_plugin} > $log_file 2>&1
if [[ $? -eq 0 ]] ; then if [[ $? -eq 0 ]] ; then
@ -2514,7 +2528,7 @@ else
error "$(cat $log_file)" error "$(cat $log_file)"
fi fi
echononl "\tCeate Symlink '$_pligin' in plugin folder.." echononl "\tCeate Symlink '$_plugin' in plugin folder.."
ln -s rc-vacation-master \ ln -s rc-vacation-master \
${WEBSITE_BASEDIR}/roundcubemail-${ROUNDCUBE_VERSION}/plugins/${_plugin} > $log_file 2>&1 ${WEBSITE_BASEDIR}/roundcubemail-${ROUNDCUBE_VERSION}/plugins/${_plugin} > $log_file 2>&1
if [[ $? -eq 0 ]] ; then if [[ $? -eq 0 ]] ; then
@ -3269,7 +3283,7 @@ else
echononl "\tCreate function 'FORWARDERS_IN'" echononl "\tCreate function 'FORWARDERS_IN'"
echo_skipped echo_skipped
warn "Create fubctions 'FORWARDERS_OUT' and 'FORWARDERS_IN' not yet implemented" warn "Create functions 'FORWARDERS_OUT' and 'FORWARDERS_IN' not yet implemented"
fi fi

View File

@ -233,7 +233,7 @@ echo -e "\n\n \033[37m\033[1mCreate some Backups..\033[m\n"
echononl " Backup existing Database '$DB_NAME'" echononl " Backup existing Database '$DB_NAME'"
if [[ "$DB_TYPE" = "mysql" ]]; then if [[ "$DB_TYPE" = "mysql" ]]; then
echo -n " (MySQL).." echo -n " (MySQL).."
mysqldump -u$_mysql_rootuser -p$_mysql_rootpass --opt $DB_NAME > ${WEBSITE_BASEDIR}/${DB_NAME}.$backup_date 2> $log_file mysqldump $MYSQL_CREDENTIALS --opt $DB_NAME > ${WEBSITE_BASEDIR}/${DB_NAME}.$backup_date.sql 2> $log_file
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
echo_ok echo_ok
else else
@ -332,7 +332,7 @@ fi
echononl " Stop Apache Webserver.." echononl " Stop Apache Webserver.."
if $SYSTEMD_EXISTS ; then if $SYSTEMD_EXISTS ; then
systemctl stop apache2 systemctl stop apache2 > $log_file 2>&1
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
echo_ok echo_ok
else else
@ -340,7 +340,7 @@ if $SYSTEMD_EXISTS ; then
fatal "$(cat $log_file)" fatal "$(cat $log_file)"
fi fi
else else
/etc/init.d/apache2 stop /etc/init.d/apache2 stop > ${logdir}/main.log 2>&1
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
echo_ok echo_ok
else else