From 839c8c87267aa43e592aebb7532ffec661836370 Mon Sep 17 00:00:00 2001 From: Trey Bastian Date: Tue, 28 Oct 2025 11:31:58 +0000 Subject: added usage instructions and relocated git-hooks --- post-receive | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 post-receive (limited to 'post-receive') diff --git a/post-receive b/post-receive deleted file mode 100644 index 458162b..0000000 --- a/post-receive +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# this post-recieve hook runs globally on my local git machine -# 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 - -REPO_PATH=$(pwd) -KNOT_FILE="$REPO_PATH/knot.conf" -LOGFILE="/home/git/knot-sync.log" #log our syncing isssues - -if [ ! -f "$KNOT_FILE" ]; then - echo "[$(date)] $REPO_PATH: knot.conf not found, skipping" >> "$LOGFILE" - exit 0 -fi -REPO_URL=$(cat "$KNOT_FILE" | tr -d '\n' | xargs) -if [ -z "$REPO_URL" ]; then - echo "[$(date)] $REPO_PATH: misconfigured knot.conf, skipping" >> "$LOGFILE" - exit 0 -fi - -echo "syncing $REPO_PATH" >> "$LOGFILE" -git push --mirror "$REPO_URL" >> "$LOGFILE" 2>&1 - -# vim: filetype=sh -- cgit v1.2.3