updated copy

This commit is contained in:
2024-10-26 16:27:22 -05:00
parent b2847ed853
commit 8f86a1dd39
6 changed files with 134 additions and 33 deletions

View File

@@ -0,0 +1,37 @@
#!/bin/bash
APP_DIR=nkode_landing_page
TAR_FILE=nkode_landing_page.tar
# Check if the tar file exists
if [ ! -f $TAR_FILE ]; then
echo "Error: $TAR_FILE not found."
exit 1
fi
# Create the target directory if it doesn't exist
mkdir -p $APP_DIR
# Extract the contents of the tar file into the target directory
tar -xvf $TAR_FILE -C $APP_DIR
# Check if extraction was successful
if [ "$(ls -A $APP_DIR)" ]; then
echo "Extraction successful."
else
echo "Error: No files extracted into $APP_DIR."
exit 1
fi
# Remove the existing directory if it exists in /var/www
if [ -d /var/www/$APP_DIR ]; then
rm -r /var/www/$APP_DIR
fi
# Move the newly extracted directory to /var/www
mv $APP_DIR /var/www
# Restart Nginx to apply changes
systemctl restart nginx
echo "Deployment successful."