#!/bin/sh /usr/local/sbin/slx-wait-online # Even though we order this after taskmanager.service, it seems systemd # still starts this up too soon, when maybe taskmanager doesn't have # the port open yet. So let's go back to good old trial-and-error sleep sleep 5 FILE=$(mktemp) if ! php /srv/openslx/www/slx-admin/api.php init > "$FILE" 2>&1; then php /srv/openslx/www/slx-admin/api.php init --crashreport "$FILE" elif [ -s "$FILE" ]; then php /srv/openslx/www/slx-admin/api.php init --logreport "$FILE" fi rm -- "$FILE" sleep 1 exit 0