diff --git a/install_nextcloud.sh b/install_nextcloud.sh index 4fbf7ae..43ad656 100755 --- a/install_nextcloud.sh +++ b/install_nextcloud.sh @@ -240,7 +240,7 @@ systemd_supported=false systemd=$(which systemd) systemctl=$(which systemctl) -if [[ -n "$systemd" ]] && [[ -n "$systemctl" ]] ; then +if [[ -n "$systemd" ]] || [[ -n "$systemctl" ]] ; then systemd_supported=true fi @@ -2704,7 +2704,14 @@ checks_all_is_fine=true # - if [[ "$DATABASE_TYPE" = "mysql" ]] ; then - if [[ ! "$(mysqlshow -h $DATABASE_HOST -u $DATABASE_USER -p$DATABASE_PASS $DATABASE_NAME 2>/dev/null)" ]] ; then + + if ! mysql \ + -h "$DATABASE_HOST" \ + -u "$DATABASE_USER" \ + -p"$DATABASE_PASS" \ + "$DATABASE_NAME" \ + -e "SELECT 1;" >/dev/null 2>&1 + then fatal "Cannot connect database \033[1m$DATABASE_NAME\033[m!" fi