diff --git a/.bin/friendica b/.bin/friendica index 1a0e3fb..e9abd27 100644 --- a/.bin/friendica +++ b/.bin/friendica @@ -98,6 +98,39 @@ friendica_help() { exit 0 } +check_database() { + TERM=dumb php -- <<'EOPHP' + +EOPHP +} + # executes the Friendica console console() { if [ -f $WORKDIR/bin/console.php ]; then @@ -177,10 +210,12 @@ install() { if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && [ "$AUTOINSTALL" = "true" ]; then - run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" - console autoinstall -f .htconfig.php - # TODO Workaround because of a strange permission issue - rm -fr ${WORKDIR}/view/smarty3/compiled + if check_database; then + run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" + console autoinstall -f .htconfig.php + # TODO Workaround because of a strange permission issue + rm -fr ${WORKDIR}/view/smarty3/compiled + fi fi } diff --git a/2018.05/apache/bin/friendica b/2018.05/apache/bin/friendica index 1a0e3fb..e9abd27 100644 --- a/2018.05/apache/bin/friendica +++ b/2018.05/apache/bin/friendica @@ -98,6 +98,39 @@ friendica_help() { exit 0 } +check_database() { + TERM=dumb php -- <<'EOPHP' + +EOPHP +} + # executes the Friendica console console() { if [ -f $WORKDIR/bin/console.php ]; then @@ -177,10 +210,12 @@ install() { if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && [ "$AUTOINSTALL" = "true" ]; then - run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" - console autoinstall -f .htconfig.php - # TODO Workaround because of a strange permission issue - rm -fr ${WORKDIR}/view/smarty3/compiled + if check_database; then + run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" + console autoinstall -f .htconfig.php + # TODO Workaround because of a strange permission issue + rm -fr ${WORKDIR}/view/smarty3/compiled + fi fi } diff --git a/2018.05/fpm-alpine/bin/friendica b/2018.05/fpm-alpine/bin/friendica index 1a0e3fb..e9abd27 100644 --- a/2018.05/fpm-alpine/bin/friendica +++ b/2018.05/fpm-alpine/bin/friendica @@ -98,6 +98,39 @@ friendica_help() { exit 0 } +check_database() { + TERM=dumb php -- <<'EOPHP' + +EOPHP +} + # executes the Friendica console console() { if [ -f $WORKDIR/bin/console.php ]; then @@ -177,10 +210,12 @@ install() { if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && [ "$AUTOINSTALL" = "true" ]; then - run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" - console autoinstall -f .htconfig.php - # TODO Workaround because of a strange permission issue - rm -fr ${WORKDIR}/view/smarty3/compiled + if check_database; then + run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" + console autoinstall -f .htconfig.php + # TODO Workaround because of a strange permission issue + rm -fr ${WORKDIR}/view/smarty3/compiled + fi fi } diff --git a/2018.05/fpm/bin/friendica b/2018.05/fpm/bin/friendica index 1a0e3fb..e9abd27 100644 --- a/2018.05/fpm/bin/friendica +++ b/2018.05/fpm/bin/friendica @@ -98,6 +98,39 @@ friendica_help() { exit 0 } +check_database() { + TERM=dumb php -- <<'EOPHP' + +EOPHP +} + # executes the Friendica console console() { if [ -f $WORKDIR/bin/console.php ]; then @@ -177,10 +210,12 @@ install() { if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && [ "$AUTOINSTALL" = "true" ]; then - run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" - console autoinstall -f .htconfig.php - # TODO Workaround because of a strange permission issue - rm -fr ${WORKDIR}/view/smarty3/compiled + if check_database; then + run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" + console autoinstall -f .htconfig.php + # TODO Workaround because of a strange permission issue + rm -fr ${WORKDIR}/view/smarty3/compiled + fi fi } diff --git a/2018.08-dev/apache/bin/friendica b/2018.08-dev/apache/bin/friendica index 1a0e3fb..e9abd27 100644 --- a/2018.08-dev/apache/bin/friendica +++ b/2018.08-dev/apache/bin/friendica @@ -98,6 +98,39 @@ friendica_help() { exit 0 } +check_database() { + TERM=dumb php -- <<'EOPHP' + +EOPHP +} + # executes the Friendica console console() { if [ -f $WORKDIR/bin/console.php ]; then @@ -177,10 +210,12 @@ install() { if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && [ "$AUTOINSTALL" = "true" ]; then - run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" - console autoinstall -f .htconfig.php - # TODO Workaround because of a strange permission issue - rm -fr ${WORKDIR}/view/smarty3/compiled + if check_database; then + run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" + console autoinstall -f .htconfig.php + # TODO Workaround because of a strange permission issue + rm -fr ${WORKDIR}/view/smarty3/compiled + fi fi } diff --git a/2018.08-dev/fpm-alpine/bin/friendica b/2018.08-dev/fpm-alpine/bin/friendica index 1a0e3fb..e9abd27 100644 --- a/2018.08-dev/fpm-alpine/bin/friendica +++ b/2018.08-dev/fpm-alpine/bin/friendica @@ -98,6 +98,39 @@ friendica_help() { exit 0 } +check_database() { + TERM=dumb php -- <<'EOPHP' + +EOPHP +} + # executes the Friendica console console() { if [ -f $WORKDIR/bin/console.php ]; then @@ -177,10 +210,12 @@ install() { if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && [ "$AUTOINSTALL" = "true" ]; then - run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" - console autoinstall -f .htconfig.php - # TODO Workaround because of a strange permission issue - rm -fr ${WORKDIR}/view/smarty3/compiled + if check_database; then + run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" + console autoinstall -f .htconfig.php + # TODO Workaround because of a strange permission issue + rm -fr ${WORKDIR}/view/smarty3/compiled + fi fi } diff --git a/2018.08-dev/fpm/bin/friendica b/2018.08-dev/fpm/bin/friendica index 1a0e3fb..e9abd27 100644 --- a/2018.08-dev/fpm/bin/friendica +++ b/2018.08-dev/fpm/bin/friendica @@ -98,6 +98,39 @@ friendica_help() { exit 0 } +check_database() { + TERM=dumb php -- <<'EOPHP' + +EOPHP +} + # executes the Friendica console console() { if [ -f $WORKDIR/bin/console.php ]; then @@ -177,10 +210,12 @@ install() { if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && [ "$AUTOINSTALL" = "true" ]; then - run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" - console autoinstall -f .htconfig.php - # TODO Workaround because of a strange permission issue - rm -fr ${WORKDIR}/view/smarty3/compiled + if check_database; then + run_as "cp ${SOURCEDIR}/config/htconfig.php ${WORKDIR}/.htconfig.php" + console autoinstall -f .htconfig.php + # TODO Workaround because of a strange permission issue + rm -fr ${WORKDIR}/view/smarty3/compiled + fi fi }