#!/bin/bash if [ ! -e /hexo ]; then cd /; git clone -b $BRANCH $REPOSITORY hexo; fi if [ -e /hexo ]; then rm -rf /hexo; cd /; git clone -b $BRANCH $REPOSITORY hexo; fi hexo server --cwd /hexo -p 80 > /logs/hexo.log 2>&1 & while true; do cd /hexo; git pull > /dev/null 2>&1 ; sleep 5; done