Site-Update-Script/update_page.sh

20 lines
421 B
Bash
Raw Normal View History

2020-03-04 14:20:33 -05:00
#!/bin/bash
GIT_URL=https://git.lain.church/Jellyman-Group/Sern-Site.git
OUTPUT_DIR=~/site
WWW_DIR=/var/www/html/
WWW_DATA_USER=www-data
# remove the old site
rm -rf $OUTPUT_DIR
# clone the new site
git clone $GIT_URL $OUTPUT_DIR
# Remove the README.md from the dir
rm $OUTPUT_DIR/README.md
# Copy data to webdir
sudo cp $OUTPUT_DIR/* $WWW_DIR
# Change ownership
sudo chown -R $WWW_DATA_USER:$WWW_DATA_USER $WWW_DIR