Fixed if check statement

This commit is contained in:
William Miceli
2019-06-09 15:11:18 -04:00
parent b4e8afa438
commit d55e25a7e5

View File

@@ -2,15 +2,15 @@
# Copy default "User" directory if none already exist
echo "[ INFO ] Checking for any existing files"
if [ -z `/var/www/user/` ]
if [ -z `ls -A /var/www/user/` ]
then
echo "No pre-existing files found (New instance)"
echo "Copying default files into the /var/www/user directory"
echo "[ INFO ] No pre-existing files found (New instance)"
echo "[ INFO ] Copying default files into the /var/www/user directory"
tar xz -f USER.tar.gz -C /
echo "Default files have been copied successfully"
echo "[ INFO ] Default files have been copied successfully"
else
echo "Pre-existing files found (Existing instance)"
echo "Not taking any action"
echo "[ INFO ] Pre-existing files found (Existing instance)"
echo "[ INFO ] Not taking any action"
fi
chown -R nginx:nginx /var/www