# it checks for the precense of a knot.conf file
# if the file exists it reads it to get the remote repo and mirror pushes
KNOT_FILE="$REPO_PATH/knot.conf"
LOGFILE="/home/git/knot-sync.log" #log our syncing isssues
if [ ! -f "$KNOT_FILE" ]; then
13
-
echo "[$(date)] $REPO_PATH: knot.conf not found, skipping", >> "$LOGFILE"
12
+
echo "[$(date)] $REPO_PATH: knot.conf not found, skipping" >> "$LOGFILE"
REPO_URL=$(cat "$KNOT_FILE" | tr -d '\n' | xargs)
if [ -z "$REPO_URL" ]; then
18
-
echo "[$(date)] $REPO_PATH: misconfigured knot.conf, skipping", >> "$LOGFILE"
17
+
echo "[$(date)] $REPO_PATH: misconfigured knot.conf, skipping" >> "$LOGFILE"
# make sure the sync occurs in the background
27
-
nohup bash -c "sync_repo" > /dev/null 2>&1 &
26
+
nohub bash -c " it push --mirror "$REPO_URL" >> "$LOGFILE" 2>&1" > /dev/nul 2>&1 &