summaryrefslogtreecommitdiffstats
path: root/satellit_installer/static_files/slxadmin/opt/openslx/slxadmin-bootscript
blob: 937de4fbaf754ea818e5bccf3429e00accb79e71 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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