From b4e8afa438704bb968c786110eb0876386983f20 Mon Sep 17 00:00:00 2001 From: William Miceli <1-WilliamMiceli@git.williammiceli.systems> Date: Sun, 9 Jun 2019 14:34:10 -0400 Subject: [PATCH] If no existing instance is found, then default files will be copied into it --- entrypoint.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index bc33037..ae3e0a0 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,12 +1,16 @@ #!/bin/sh # Copy default "User" directory if none already exist -echo "[ INFO ] Checking if the /user/data " -if [ -e /var/www/user/data ] +echo "[ INFO ] Checking for any existing files" +if [ -z `/var/www/user/` ] then - echo "True" + echo "No pre-existing files found (New instance)" + echo "Copying default files into the /var/www/user directory" + tar xz -f USER.tar.gz -C / + echo "Default files have been copied successfully" else - echo "False" + echo "Pre-existing files found (Existing instance)" + echo "Not taking any action" fi chown -R nginx:nginx /var/www