If no existing instance is found, then default files will be copied into it

This commit is contained in:
William Miceli
2019-06-09 14:34:10 -04:00
parent 158d357875
commit b4e8afa438

View File

@@ -1,12 +1,16 @@
#!/bin/sh #!/bin/sh
# Copy default "User" directory if none already exist # Copy default "User" directory if none already exist
echo "[ INFO ] Checking if the /user/data " echo "[ INFO ] Checking for any existing files"
if [ -e /var/www/user/data ] if [ -z `/var/www/user/` ]
then 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 else
echo "False" echo "Pre-existing files found (Existing instance)"
echo "Not taking any action"
fi fi
chown -R nginx:nginx /var/www chown -R nginx:nginx /var/www