This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
freshrss/overlay/usr/local/bin/entrypoint.sh

36 lines
1.0 KiB
Bash
Raw Normal View History

2019-10-02 07:43:32 +00:00
#!/bin/sh
2019-10-02 07:43:32 +00:00
/usr/local/bin/gomplate -V -o /etc/php7/php.ini -f /etc/templates/php.ini.tmpl
/usr/local/bin/gomplate -V -o /var/www/app/data/config.php -f /etc/templates/config.php.tmpl
/usr/local/bin/gomplate -V -o /var/www/app/constants.local.php -f /etc/templates/constants.local.php.tmpl
printf "\nPrepare FreshRSS...\n"
2019-10-03 12:10:42 +00:00
PREP=$(/usr/bin/php -f ./cli/prepare.php)
if [ $? -ne 0 ]; then
echo $PREP
exit 1
fi
2019-10-02 07:43:32 +00:00
if [ "${FRESHRSS_DEFAULT_USER}" ]; then
printf "\nEnsure default user exists...\n"
UCREATE=$(/usr/bin/php ./cli/create-user.php --user "$FRESHRSS_DEFAULT_USER" --password "$FRESHRSS_DEFAULT_PASSWORD" 2>&1)
if [ $? -ne 0 ]; then
case "$UCREATE" in
*"username already taken"*) ;;
*)
echo $UCREATE
exit 1
;;
esac
fi
printf "Result: success\n\n"
fi
if [ -f "/var/www/app/data/do-install.txt" ]; then
rm -rf /var/www/app/data/do-install.txt
2019-10-02 07:43:32 +00:00
fi
2019-10-04 07:02:25 +00:00
exec supercronic -split-logs /etc/crontabs/nginx
2019-10-02 07:43:32 +00:00
exec php-fpm7 -F &
exec nginx -g "daemon off;"