2016-06-20 20:41:47 +00:00
|
|
|
#!/bin/sh
|
2021-04-04 10:43:39 +00:00
|
|
|
|
|
|
|
php_bin=""
|
2023-04-04 18:29:24 +00:00
|
|
|
host=localhost
|
2016-08-19 09:23:42 +00:00
|
|
|
port=8000
|
2021-04-04 10:43:39 +00:00
|
|
|
|
2023-04-07 23:18:50 +00:00
|
|
|
for try_bin in php74 php7.4 php7 php
|
2021-04-04 10:43:39 +00:00
|
|
|
do
|
|
|
|
php_bin=$(command -v $try_bin)
|
2021-04-29 17:28:45 +00:00
|
|
|
if [ -n "$php_bin" ]
|
2021-04-04 10:43:39 +00:00
|
|
|
then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Using PHP: $php_bin"
|
|
|
|
|
2023-04-04 18:29:24 +00:00
|
|
|
if [ -n "$2" ]
|
|
|
|
then
|
|
|
|
host=$1
|
|
|
|
port=$2
|
|
|
|
elif [ -n "$1" ]
|
2021-04-04 10:43:39 +00:00
|
|
|
then
|
|
|
|
port=$1
|
|
|
|
fi
|
|
|
|
|
2022-04-15 14:13:22 +00:00
|
|
|
# check if we should update schedules, upcoming, etc.
|
2022-05-20 17:13:36 +00:00
|
|
|
if [ -z "$(find "configs/upcoming.json" -newermt "8 hours ago")" ]; then
|
2022-04-15 14:13:22 +00:00
|
|
|
echo "Updating schedules…\n"
|
2023-04-07 23:18:50 +00:00
|
|
|
$php_bin -d short_open_tag=true index.php download
|
2022-04-15 14:13:22 +00:00
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
2023-04-04 18:29:24 +00:00
|
|
|
$php_bin -S $host:$port -d short_open_tag=true $3 index.php
|