Site-Update-Script/update_page.sh
2020-03-04 20:20:33 +01:00

20 lignes
421 B
Bash

#!/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