summaryrefslogtreecommitdiffstats
path: root/satellit_installer/static_files/slxadmin/opt/openslx/slxadmin-cronscript
blob: 4ab7a216b85a95cbe0ab97530e42d23401611c97 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

PIDFILE="/tmp/bwlp-cronphppid"
OLDPID=
[ -s "$PIDFILE" ] && OLDPID=$(cat "$PIDFILE")

[ -n "$OLDPID" ] && kill -0 "$OLDPID" && exit 0

echo $$ > "$PIDFILE"

FILE=$(mktemp)
if ! php /srv/openslx/www/slx-admin/api.php cron >"$FILE" 2>&1; then
	php /srv/openslx/www/slx-admin/api.php cron --crashreport "$FILE"
fi
rm -f -- "$FILE" "$PIDFILE"
exit 0