23 lines
422 B
Bash
23 lines
422 B
Bash
#!/bin/bash
|
|
|
|
if [ ! -e /hexo ]; then
|
|
cd /;
|
|
git clone -b $BRANCH $REPOSITORY hexo;
|
|
fi
|
|
|
|
if [ -e /hexo/install.sh ]; then
|
|
cd /hexo;
|
|
sh ./install.sh;
|
|
fi
|
|
|
|
|
|
hexo server --cwd /hexo -p 80 > /logs/hexo.log 2>&1 &
|
|
|
|
while true;
|
|
do
|
|
cd /hexo;
|
|
git fetch --all > /dev/null 2>&1 ;
|
|
git reset --hard origin/$BRANCH > /dev/null 2>&1 ;
|
|
git pull > /dev/null 2>&1 ;
|
|
sleep 5;
|
|
done |