OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/packaging/scripts/check

47 lines
1.0 KiB

10 years ago
#!/bin/bash
set -e
log_ok() {
echo -e "\e[32m[ok]\e[0m $1"
}
log_ko() {
echo -e "\e[31m[ko]\e[0m $1"
}
# try to get a setting to make sure database connection works
if rake openproject:db:check_connection 2>/dev/null; then
log_ok "PostgreSQL configuration is working"
10 years ago
else
log_ko "PostgreSQL connection is NOT working"
10 years ago
fi
if ps -u "$SERVER_USER" &>/dev/null ; then
log_ok "Web server is running"
10 years ago
else
log_ko "Web server is NOT running"
10 years ago
fi
if ps -u "$APP_USER" -f | grep -q "unicorn worker" ; then
10 years ago
log_ok "openproject server is running"
else
log_ko "openproject server is NOT running"
fi
if ps -u "$APP_USER" -f | grep -q "rake jobs:work" ; then
10 years ago
log_ok "openproject background job worker is running"
else
log_ko "openproject background job worker is NOT running"
fi
if [ -z "$ADMIN_EMAIL" ]; then
log_ko "no ADMIN_EMAIL set. Can't test email settings."
else
if $(pwd)/packaging/scripts/send-test-email ; then
log_ok "test email sent to ${ADMIN_EMAIL}"
else
log_ko "unable to send test email to ${ADMIN_EMAIL}"
fi
fi