blob: 1df48a36234101f5fc1c64f474c0bdf429cfe02b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/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
cat "$FILE"
rm -- "$FILE"
sleep 1
exit 0
|