Robert Kaussow
3344066b80
All checks were successful
continuous-integration/drone/push Build is passing
41 lines
1.2 KiB
Bash
Executable File
41 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
/usr/local/bin/gomplate -o /etc/php7/php.ini -f /etc/templates/php.ini.tmpl
|
|
/usr/local/bin/gomplate -o /var/www/app/data/config.php -f /etc/templates/config.php.tmpl
|
|
/usr/local/bin/gomplate -o /var/www/app/constants.local.php -f /etc/templates/constants.local.php.tmpl
|
|
|
|
if [ -n "${FRESHRSS_POSTGRES_SSL_ROOTCERT}" ] && [ ! -f "/var/www/.postgresql/root.crt" ]; then
|
|
ln -s "${FRESHRSS_POSTGRES_SSL_ROOTCERT}" /var/www/.postgresql/root.crt
|
|
fi
|
|
|
|
printf "\nPrepare FreshRSS...\n"
|
|
PREP=$(/usr/bin/php -f ./cli/prepare.php)
|
|
if [ $? -ne 0 ]; then
|
|
echo "$PREP"
|
|
exit 1
|
|
fi
|
|
|
|
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"
|
|
rm -rf "/var/www/app/data/users/$FRESHRSS_DEFAULT_USER"
|
|
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
|
|
fi
|
|
|
|
supercronic /etc/crontabs/nginx &
|
|
php-fpm7 -F &
|
|
exec nginx -g "daemon off;"
|