0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2024-12-26 19:16:13 +01:00

fixed expansion of environment variables

This commit is contained in:
Marc Brückner 2018-09-27 09:58:47 +02:00
parent 45bf61d190
commit dbadf5520b
10 changed files with 80 additions and 80 deletions

View file

@ -13,7 +13,7 @@ directory_empty() {
run_as() { run_as() {
if [ "$(id -u)" = 0 ]; then if [ "$(id -u)" = 0 ]; then
su - www-data -s /bin/sh -c "$1" su -p www-data -s /bin/sh -c "$1"
else else
sh -c "$1" sh -c "$1"
fi fi
@ -55,30 +55,30 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
install_options="-n --admin-user \"$NEXTCLOUD_ADMIN_USER\" --admin-pass \"$NEXTCLOUD_ADMIN_PASSWORD\"" install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
install_options="$install_options --database-table-prefix \"$NEXTCLOUD_TABLE_PREFIX\"" install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else else
install_options="$install_options --database-table-prefix \"\"" install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
install_options="$install_options --data-dir \"$NEXTCLOUD_DATA_DIR\"" install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi fi
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
install_options="$install_options --database-name \"$SQLITE_DATABASE\"" install_options=$install_options' --database-name "$SQLITE_DATABASE"'
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then
echo "Installing with MySQL database" echo "Installing with MySQL database"
install_options="$install_options --database mysql --database-name \"$MYSQL_DATABASE\" --database-user \"$MYSQL_USER\" --database-pass \"$MYSQL_PASSWORD\" --database-host \"$MYSQL_HOST\"" install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
echo "waiting 30s for the database to setup" echo "waiting 30s for the database to setup"
sleep 30s sleep 30s
echo "starting nexcloud installation" echo "starting nexcloud installation"
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
echo "Installing with PostgreSQL database" echo "Installing with PostgreSQL database"
install_options="$install_options --database pgsql --database-name \"$POSTGRES_DB\" --database-user \"$POSTGRES_USER\" --database-pass \"$POSTGRES_PASSWORD\" --database-host \"$POSTGRES_HOST\"" install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
echo "waiting 10s for the database to setup" echo "waiting 10s for the database to setup"
sleep 10s sleep 10s
echo "starting nexcloud installation" echo "starting nexcloud installation"

View file

@ -13,7 +13,7 @@ directory_empty() {
run_as() { run_as() {
if [ "$(id -u)" = 0 ]; then if [ "$(id -u)" = 0 ]; then
su - www-data -s /bin/sh -c "$1" su -p www-data -s /bin/sh -c "$1"
else else
sh -c "$1" sh -c "$1"
fi fi
@ -55,30 +55,30 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
install_options="-n --admin-user \"$NEXTCLOUD_ADMIN_USER\" --admin-pass \"$NEXTCLOUD_ADMIN_PASSWORD\"" install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
install_options="$install_options --database-table-prefix \"$NEXTCLOUD_TABLE_PREFIX\"" install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else else
install_options="$install_options --database-table-prefix \"\"" install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
install_options="$install_options --data-dir \"$NEXTCLOUD_DATA_DIR\"" install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi fi
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
install_options="$install_options --database-name \"$SQLITE_DATABASE\"" install_options=$install_options' --database-name "$SQLITE_DATABASE"'
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then
echo "Installing with MySQL database" echo "Installing with MySQL database"
install_options="$install_options --database mysql --database-name \"$MYSQL_DATABASE\" --database-user \"$MYSQL_USER\" --database-pass \"$MYSQL_PASSWORD\" --database-host \"$MYSQL_HOST\"" install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
echo "waiting 30s for the database to setup" echo "waiting 30s for the database to setup"
sleep 30s sleep 30s
echo "starting nexcloud installation" echo "starting nexcloud installation"
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
echo "Installing with PostgreSQL database" echo "Installing with PostgreSQL database"
install_options="$install_options --database pgsql --database-name \"$POSTGRES_DB\" --database-user \"$POSTGRES_USER\" --database-pass \"$POSTGRES_PASSWORD\" --database-host \"$POSTGRES_HOST\"" install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
echo "waiting 10s for the database to setup" echo "waiting 10s for the database to setup"
sleep 10s sleep 10s
echo "starting nexcloud installation" echo "starting nexcloud installation"

View file

@ -13,7 +13,7 @@ directory_empty() {
run_as() { run_as() {
if [ "$(id -u)" = 0 ]; then if [ "$(id -u)" = 0 ]; then
su - www-data -s /bin/sh -c "$1" su -p www-data -s /bin/sh -c "$1"
else else
sh -c "$1" sh -c "$1"
fi fi
@ -55,30 +55,30 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
install_options="-n --admin-user \"$NEXTCLOUD_ADMIN_USER\" --admin-pass \"$NEXTCLOUD_ADMIN_PASSWORD\"" install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
install_options="$install_options --database-table-prefix \"$NEXTCLOUD_TABLE_PREFIX\"" install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else else
install_options="$install_options --database-table-prefix \"\"" install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
install_options="$install_options --data-dir \"$NEXTCLOUD_DATA_DIR\"" install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi fi
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
install_options="$install_options --database-name \"$SQLITE_DATABASE\"" install_options=$install_options' --database-name "$SQLITE_DATABASE"'
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then
echo "Installing with MySQL database" echo "Installing with MySQL database"
install_options="$install_options --database mysql --database-name \"$MYSQL_DATABASE\" --database-user \"$MYSQL_USER\" --database-pass \"$MYSQL_PASSWORD\" --database-host \"$MYSQL_HOST\"" install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
echo "waiting 30s for the database to setup" echo "waiting 30s for the database to setup"
sleep 30s sleep 30s
echo "starting nexcloud installation" echo "starting nexcloud installation"
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
echo "Installing with PostgreSQL database" echo "Installing with PostgreSQL database"
install_options="$install_options --database pgsql --database-name \"$POSTGRES_DB\" --database-user \"$POSTGRES_USER\" --database-pass \"$POSTGRES_PASSWORD\" --database-host \"$POSTGRES_HOST\"" install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
echo "waiting 10s for the database to setup" echo "waiting 10s for the database to setup"
sleep 10s sleep 10s
echo "starting nexcloud installation" echo "starting nexcloud installation"

View file

@ -13,7 +13,7 @@ directory_empty() {
run_as() { run_as() {
if [ "$(id -u)" = 0 ]; then if [ "$(id -u)" = 0 ]; then
su - www-data -s /bin/sh -c "$1" su -p www-data -s /bin/sh -c "$1"
else else
sh -c "$1" sh -c "$1"
fi fi
@ -55,30 +55,30 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
install_options="-n --admin-user \"$NEXTCLOUD_ADMIN_USER\" --admin-pass \"$NEXTCLOUD_ADMIN_PASSWORD\"" install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
install_options="$install_options --database-table-prefix \"$NEXTCLOUD_TABLE_PREFIX\"" install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else else
install_options="$install_options --database-table-prefix \"\"" install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
install_options="$install_options --data-dir \"$NEXTCLOUD_DATA_DIR\"" install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi fi
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
install_options="$install_options --database-name \"$SQLITE_DATABASE\"" install_options=$install_options' --database-name "$SQLITE_DATABASE"'
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then
echo "Installing with MySQL database" echo "Installing with MySQL database"
install_options="$install_options --database mysql --database-name \"$MYSQL_DATABASE\" --database-user \"$MYSQL_USER\" --database-pass \"$MYSQL_PASSWORD\" --database-host \"$MYSQL_HOST\"" install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
echo "waiting 30s for the database to setup" echo "waiting 30s for the database to setup"
sleep 30s sleep 30s
echo "starting nexcloud installation" echo "starting nexcloud installation"
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
echo "Installing with PostgreSQL database" echo "Installing with PostgreSQL database"
install_options="$install_options --database pgsql --database-name \"$POSTGRES_DB\" --database-user \"$POSTGRES_USER\" --database-pass \"$POSTGRES_PASSWORD\" --database-host \"$POSTGRES_HOST\"" install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
echo "waiting 10s for the database to setup" echo "waiting 10s for the database to setup"
sleep 10s sleep 10s
echo "starting nexcloud installation" echo "starting nexcloud installation"

View file

@ -13,7 +13,7 @@ directory_empty() {
run_as() { run_as() {
if [ "$(id -u)" = 0 ]; then if [ "$(id -u)" = 0 ]; then
su - www-data -s /bin/sh -c "$1" su -p www-data -s /bin/sh -c "$1"
else else
sh -c "$1" sh -c "$1"
fi fi
@ -55,30 +55,30 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
install_options="-n --admin-user \"$NEXTCLOUD_ADMIN_USER\" --admin-pass \"$NEXTCLOUD_ADMIN_PASSWORD\"" install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
install_options="$install_options --database-table-prefix \"$NEXTCLOUD_TABLE_PREFIX\"" install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else else
install_options="$install_options --database-table-prefix \"\"" install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
install_options="$install_options --data-dir \"$NEXTCLOUD_DATA_DIR\"" install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi fi
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
install_options="$install_options --database-name \"$SQLITE_DATABASE\"" install_options=$install_options' --database-name "$SQLITE_DATABASE"'
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then
echo "Installing with MySQL database" echo "Installing with MySQL database"
install_options="$install_options --database mysql --database-name \"$MYSQL_DATABASE\" --database-user \"$MYSQL_USER\" --database-pass \"$MYSQL_PASSWORD\" --database-host \"$MYSQL_HOST\"" install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
echo "waiting 30s for the database to setup" echo "waiting 30s for the database to setup"
sleep 30s sleep 30s
echo "starting nexcloud installation" echo "starting nexcloud installation"
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
echo "Installing with PostgreSQL database" echo "Installing with PostgreSQL database"
install_options="$install_options --database pgsql --database-name \"$POSTGRES_DB\" --database-user \"$POSTGRES_USER\" --database-pass \"$POSTGRES_PASSWORD\" --database-host \"$POSTGRES_HOST\"" install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
echo "waiting 10s for the database to setup" echo "waiting 10s for the database to setup"
sleep 10s sleep 10s
echo "starting nexcloud installation" echo "starting nexcloud installation"

View file

@ -13,7 +13,7 @@ directory_empty() {
run_as() { run_as() {
if [ "$(id -u)" = 0 ]; then if [ "$(id -u)" = 0 ]; then
su - www-data -s /bin/sh -c "$1" su -p www-data -s /bin/sh -c "$1"
else else
sh -c "$1" sh -c "$1"
fi fi
@ -55,30 +55,30 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
install_options="-n --admin-user \"$NEXTCLOUD_ADMIN_USER\" --admin-pass \"$NEXTCLOUD_ADMIN_PASSWORD\"" install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
install_options="$install_options --database-table-prefix \"$NEXTCLOUD_TABLE_PREFIX\"" install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else else
install_options="$install_options --database-table-prefix \"\"" install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
install_options="$install_options --data-dir \"$NEXTCLOUD_DATA_DIR\"" install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi fi
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
install_options="$install_options --database-name \"$SQLITE_DATABASE\"" install_options=$install_options' --database-name "$SQLITE_DATABASE"'
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then
echo "Installing with MySQL database" echo "Installing with MySQL database"
install_options="$install_options --database mysql --database-name \"$MYSQL_DATABASE\" --database-user \"$MYSQL_USER\" --database-pass \"$MYSQL_PASSWORD\" --database-host \"$MYSQL_HOST\"" install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
echo "waiting 30s for the database to setup" echo "waiting 30s for the database to setup"
sleep 30s sleep 30s
echo "starting nexcloud installation" echo "starting nexcloud installation"
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
echo "Installing with PostgreSQL database" echo "Installing with PostgreSQL database"
install_options="$install_options --database pgsql --database-name \"$POSTGRES_DB\" --database-user \"$POSTGRES_USER\" --database-pass \"$POSTGRES_PASSWORD\" --database-host \"$POSTGRES_HOST\"" install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
echo "waiting 10s for the database to setup" echo "waiting 10s for the database to setup"
sleep 10s sleep 10s
echo "starting nexcloud installation" echo "starting nexcloud installation"

View file

@ -13,7 +13,7 @@ directory_empty() {
run_as() { run_as() {
if [ "$(id -u)" = 0 ]; then if [ "$(id -u)" = 0 ]; then
su - www-data -s /bin/sh -c "$1" su -p www-data -s /bin/sh -c "$1"
else else
sh -c "$1" sh -c "$1"
fi fi
@ -55,30 +55,30 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
install_options="-n --admin-user \"$NEXTCLOUD_ADMIN_USER\" --admin-pass \"$NEXTCLOUD_ADMIN_PASSWORD\"" install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
install_options="$install_options --database-table-prefix \"$NEXTCLOUD_TABLE_PREFIX\"" install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else else
install_options="$install_options --database-table-prefix \"\"" install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
install_options="$install_options --data-dir \"$NEXTCLOUD_DATA_DIR\"" install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi fi
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
install_options="$install_options --database-name \"$SQLITE_DATABASE\"" install_options=$install_options' --database-name "$SQLITE_DATABASE"'
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then
echo "Installing with MySQL database" echo "Installing with MySQL database"
install_options="$install_options --database mysql --database-name \"$MYSQL_DATABASE\" --database-user \"$MYSQL_USER\" --database-pass \"$MYSQL_PASSWORD\" --database-host \"$MYSQL_HOST\"" install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
echo "waiting 30s for the database to setup" echo "waiting 30s for the database to setup"
sleep 30s sleep 30s
echo "starting nexcloud installation" echo "starting nexcloud installation"
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
echo "Installing with PostgreSQL database" echo "Installing with PostgreSQL database"
install_options="$install_options --database pgsql --database-name \"$POSTGRES_DB\" --database-user \"$POSTGRES_USER\" --database-pass \"$POSTGRES_PASSWORD\" --database-host \"$POSTGRES_HOST\"" install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
echo "waiting 10s for the database to setup" echo "waiting 10s for the database to setup"
sleep 10s sleep 10s
echo "starting nexcloud installation" echo "starting nexcloud installation"

View file

@ -13,7 +13,7 @@ directory_empty() {
run_as() { run_as() {
if [ "$(id -u)" = 0 ]; then if [ "$(id -u)" = 0 ]; then
su - www-data -s /bin/sh -c "$1" su -p www-data -s /bin/sh -c "$1"
else else
sh -c "$1" sh -c "$1"
fi fi
@ -55,30 +55,30 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
install_options="-n --admin-user \"$NEXTCLOUD_ADMIN_USER\" --admin-pass \"$NEXTCLOUD_ADMIN_PASSWORD\"" install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
install_options="$install_options --database-table-prefix \"$NEXTCLOUD_TABLE_PREFIX\"" install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else else
install_options="$install_options --database-table-prefix \"\"" install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
install_options="$install_options --data-dir \"$NEXTCLOUD_DATA_DIR\"" install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi fi
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
install_options="$install_options --database-name \"$SQLITE_DATABASE\"" install_options=$install_options' --database-name "$SQLITE_DATABASE"'
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then
echo "Installing with MySQL database" echo "Installing with MySQL database"
install_options="$install_options --database mysql --database-name \"$MYSQL_DATABASE\" --database-user \"$MYSQL_USER\" --database-pass \"$MYSQL_PASSWORD\" --database-host \"$MYSQL_HOST\"" install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
echo "waiting 30s for the database to setup" echo "waiting 30s for the database to setup"
sleep 30s sleep 30s
echo "starting nexcloud installation" echo "starting nexcloud installation"
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
echo "Installing with PostgreSQL database" echo "Installing with PostgreSQL database"
install_options="$install_options --database pgsql --database-name \"$POSTGRES_DB\" --database-user \"$POSTGRES_USER\" --database-pass \"$POSTGRES_PASSWORD\" --database-host \"$POSTGRES_HOST\"" install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
echo "waiting 10s for the database to setup" echo "waiting 10s for the database to setup"
sleep 10s sleep 10s
echo "starting nexcloud installation" echo "starting nexcloud installation"

View file

@ -13,7 +13,7 @@ directory_empty() {
run_as() { run_as() {
if [ "$(id -u)" = 0 ]; then if [ "$(id -u)" = 0 ]; then
su - www-data -s /bin/sh -c "$1" su -p www-data -s /bin/sh -c "$1"
else else
sh -c "$1" sh -c "$1"
fi fi
@ -55,30 +55,30 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
install_options="-n --admin-user \"$NEXTCLOUD_ADMIN_USER\" --admin-pass \"$NEXTCLOUD_ADMIN_PASSWORD\"" install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
install_options="$install_options --database-table-prefix \"$NEXTCLOUD_TABLE_PREFIX\"" install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else else
install_options="$install_options --database-table-prefix \"\"" install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
install_options="$install_options --data-dir \"$NEXTCLOUD_DATA_DIR\"" install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi fi
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
install_options="$install_options --database-name \"$SQLITE_DATABASE\"" install_options=$install_options' --database-name "$SQLITE_DATABASE"'
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then
echo "Installing with MySQL database" echo "Installing with MySQL database"
install_options="$install_options --database mysql --database-name \"$MYSQL_DATABASE\" --database-user \"$MYSQL_USER\" --database-pass \"$MYSQL_PASSWORD\" --database-host \"$MYSQL_HOST\"" install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
echo "waiting 30s for the database to setup" echo "waiting 30s for the database to setup"
sleep 30s sleep 30s
echo "starting nexcloud installation" echo "starting nexcloud installation"
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
echo "Installing with PostgreSQL database" echo "Installing with PostgreSQL database"
install_options="$install_options --database pgsql --database-name \"$POSTGRES_DB\" --database-user \"$POSTGRES_USER\" --database-pass \"$POSTGRES_PASSWORD\" --database-host \"$POSTGRES_HOST\"" install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
echo "waiting 10s for the database to setup" echo "waiting 10s for the database to setup"
sleep 10s sleep 10s
echo "starting nexcloud installation" echo "starting nexcloud installation"

View file

@ -13,7 +13,7 @@ directory_empty() {
run_as() { run_as() {
if [ "$(id -u)" = 0 ]; then if [ "$(id -u)" = 0 ]; then
su - www-data -s /bin/sh -c "$1" su -p www-data -s /bin/sh -c "$1"
else else
sh -c "$1" sh -c "$1"
fi fi
@ -55,30 +55,30 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
echo "New nextcloud instance" echo "New nextcloud instance"
if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then if [ -n "${NEXTCLOUD_ADMIN_USER+x}" ] && [ -n "${NEXTCLOUD_ADMIN_PASSWORD+x}" ]; then
install_options="-n --admin-user \"$NEXTCLOUD_ADMIN_USER\" --admin-pass \"$NEXTCLOUD_ADMIN_PASSWORD\"" install_options='-n --admin-user "$NEXTCLOUD_ADMIN_USER" --admin-pass "$NEXTCLOUD_ADMIN_PASSWORD"'
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
install_options="$install_options --database-table-prefix \"$NEXTCLOUD_TABLE_PREFIX\"" install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else else
install_options="$install_options --database-table-prefix \"\"" install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
install_options="$install_options --data-dir \"$NEXTCLOUD_DATA_DIR\"" install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi fi
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
install_options="$install_options --database-name \"$SQLITE_DATABASE\"" install_options=$install_options' --database-name "$SQLITE_DATABASE"'
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then elif [ -n "${MYSQL_DATABASE+x}" ] && [ -n "${MYSQL_USER+x}" ] && [ -n "${MYSQL_PASSWORD+x}" ] && [ -n "${MYSQL_HOST+x}" ]; then
echo "Installing with MySQL database" echo "Installing with MySQL database"
install_options="$install_options --database mysql --database-name \"$MYSQL_DATABASE\" --database-user \"$MYSQL_USER\" --database-pass \"$MYSQL_PASSWORD\" --database-host \"$MYSQL_HOST\"" install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
echo "waiting 30s for the database to setup" echo "waiting 30s for the database to setup"
sleep 30s sleep 30s
echo "starting nexcloud installation" echo "starting nexcloud installation"
run_as "php /var/www/html/occ maintenance:install $install_options" run_as "php /var/www/html/occ maintenance:install $install_options"
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
echo "Installing with PostgreSQL database" echo "Installing with PostgreSQL database"
install_options="$install_options --database pgsql --database-name \"$POSTGRES_DB\" --database-user \"$POSTGRES_USER\" --database-pass \"$POSTGRES_PASSWORD\" --database-host \"$POSTGRES_HOST\"" install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
echo "waiting 10s for the database to setup" echo "waiting 10s for the database to setup"
sleep 10s sleep 10s
echo "starting nexcloud installation" echo "starting nexcloud installation"