summaryrefslogblamecommitdiffstats
path: root/satellit_installer/static_files/slxadmin/opt/openslx/slxadmin-bootscript
blob: 1df48a36234101f5fc1c64f474c0bdf429cfe02b (plain) (tree)
1
2
3
4
5
6
7
8
9

         

                               




                                                                       



                                                                         

                                                                       

  
           

             
 
      
#!/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