diff options
| author | Trey Bastian <hello@treybastian.com> | 2025-10-28 10:26:14 +0000 |
|---|---|---|
| committer | Trey Bastian <hello@treybastian.com> | 2025-10-28 10:26:14 +0000 |
| commit | ecc5e73cf991dc4e3cfe87312179f57021f2b1f5 (patch) | |
| tree | 6715d70f4fc10b770cd86b1e271463725bb252f1 | |
| parent | b0aa301af1ceb109ab9887bb1fc92d5c1451ede8 (diff) | |
fixed dumb mistake where function doesn't pash to nohup obviously...
| -rw-r--r-- | post-receive | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/post-receive b/post-receive index e2aeb04..28db0c5 100644 --- a/post-receive +++ b/post-receive @@ -4,18 +4,17 @@ # 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" + 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" + echo "[$(date)] $REPO_PATH: misconfigured knot.conf, skipping" >> "$LOGFILE" exit 0 fi @@ -24,5 +23,7 @@ sync_repo() { } # make sure the sync occurs in the background -nohup bash -c "sync_repo" > /dev/null 2>&1 & +nohub bash -c " it push --mirror "$REPO_URL" >> "$LOGFILE" 2>&1" > /dev/nul 2>&1 & + # vim: filetype=sh + |
