openlut/doc/upload.sh

26 lines
481 B
Bash
Raw Normal View History

2017-01-26 05:13:57 +01:00
#!/bin/bash
2017-01-27 00:35:08 +01:00
USER="$1"
if [ -z $USER ]; then USER="sofus"; fi
REMOTE="${USER}@wakingnexus"
2017-01-26 05:13:57 +01:00
2017-01-26 23:07:35 +01:00
#Remove the old docs.
ssh $REMOTE 'bash -s' << 'ENDSSH'
rm -rf /var/www/openlut/*
ENDSSH
#Sync over the new docs.
rsync -avzP build/html/* $REMOTE:/var/www/openlut/
#Set strong permissions.
ssh $REMOTE 'bash -s' << 'ENDSSH'
2017-01-27 00:35:08 +01:00
chown -R $USER:www-data /var/www/openlut/*
2017-01-26 23:07:35 +01:00
find /var/www/openlut -type f -exec chmod 0640 {} \;
find /var/www/openlut -type d -exec chmod 2750 {} \;
ENDSSH