Files
staticzolaserver-docker/git2zola.sh
T

31 lines
604 B
Bash
Executable File

#!/bin/bash
# bash deamon to check git for new content
# make a pull from repository
# - with ssh keys ( problem with private key in this repository )
# - with https user login ( problrm with TLS error with own gogs
# - with auth token (not implemented in gogs yet)
if [ -z $IDLE_TIME ]
then
# one day
IDLE_TIME=86400
fi
trap "exit" EXIT
while true
do
git status --porcelain
gitstatus=$?
echo ${gitstatus}
if [ ${gitstatus} -eq 128 ]
then
git clone ${GITCLONEURL}
elif [ ${gitstatus} -eq 0 ]
then
git pull
fi
sleep ${IDLE_TIME}
done