From 28d6905bf425350a6e1d0ca87e753eadca5b5642 Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 17 Apr 2022 11:57:32 +0100 Subject: [PATCH 1/6] Quick test --- usr.local.bin/testfile | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 usr.local.bin/testfile diff --git a/usr.local.bin/testfile b/usr.local.bin/testfile new file mode 100644 index 0000000..ce50b6c --- /dev/null +++ b/usr.local.bin/testfile @@ -0,0 +1,2 @@ +# This just tests if a file appears in /usr/local/bin +# if so, we can use this repo to deploy files out to repos \ No newline at end of file From df75032023fb2ba28c6b98c425df1c25fdfc0b4e Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 2 May 2022 12:03:10 +0100 Subject: [PATCH 2/6] Add 'usr.local.sbin/root-script' --- usr.local.sbin/root-script | 1 + 1 file changed, 1 insertion(+) create mode 100644 usr.local.sbin/root-script diff --git a/usr.local.sbin/root-script b/usr.local.sbin/root-script new file mode 100644 index 0000000..527076c --- /dev/null +++ b/usr.local.sbin/root-script @@ -0,0 +1 @@ +## something new here \ No newline at end of file From 668130bd7091e0ec226ce412eb0393caf9a50ddd Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 2 May 2022 12:04:43 +0100 Subject: [PATCH 3/6] Added repofix to /usr/local/sbin Shifted to root-specified path --- usr.local.sbin/repofix | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 usr.local.sbin/repofix diff --git a/usr.local.sbin/repofix b/usr.local.sbin/repofix new file mode 100644 index 0000000..7a1fb7d --- /dev/null +++ b/usr.local.sbin/repofix @@ -0,0 +1,48 @@ +#!/bin/bash + +# HEADER: =========================================================== +# HEADER: This file is automanaged by puppet +# HEADER: While it can still be managed manually, it is definitely not recommended. +# HEADER: Any manual changes to this file run the risk of being overwritten! +# HEADER: =========================================================== + +## "repofix" keeps the puppet manifests updated from gitea +## a quick check confirms alterationa to local files +## else.. those are updated with latest from gitea + +set -u + +## -- path to the Puppet manifest dirs +REPOBASE=/var/lib/puppet/manifests + +## location of logfiles +LOGPATH=/var/log/repofix +LOGFILE=${LOGPATH}/repofix.log + +## -- just check that the logpath exists +[ ! -d ${LOGPATH} ] && mkdir -p ${LOGPATH} + +echo "$(date +'%F_%R:%S') ==== START ==== " >> ${LOGFILE} + +## -- check each repo in turn +cd ${REPOBASE} +for REPO in $(ls -d *) +do + cd ${REPOBASE}/${REPO} + echo -e "$(date +'%F_%R:%S') checking ${REPO} ... \c" + STATUS="$(git status | tail -n1)" + if [[ ! ${STATUS} =~ "nothing to commit" ]] + then + echo "need to fix $REPO, showing diff on next line" + git diff + git fetch origin &> /dev/null + git reset --hard origin/master &> /dev/null + else + echo " ${STATUS}" + fi + git pull &> /dev/null +done >> ${LOGFILE} + +echo "$(date +'%F_%R:%S') ------ END ------" >> ${LOGFILE} + + From 2a4d2aaa791b4bc814fb2782528e6ccc77a8db3f Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 2 May 2022 12:23:42 +0100 Subject: [PATCH 4/6] Removed logging; will trap output in cron Permits manual running of "repofix" --- usr.local.sbin/repofix | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/usr.local.sbin/repofix b/usr.local.sbin/repofix index 7a1fb7d..3192a59 100644 --- a/usr.local.sbin/repofix +++ b/usr.local.sbin/repofix @@ -15,14 +15,7 @@ set -u ## -- path to the Puppet manifest dirs REPOBASE=/var/lib/puppet/manifests -## location of logfiles -LOGPATH=/var/log/repofix -LOGFILE=${LOGPATH}/repofix.log - -## -- just check that the logpath exists -[ ! -d ${LOGPATH} ] && mkdir -p ${LOGPATH} - -echo "$(date +'%F_%R:%S') ==== START ==== " >> ${LOGFILE} +echo "$(date +'%F_%R:%S') ==== START ==== " ## -- check each repo in turn cd ${REPOBASE} @@ -41,8 +34,8 @@ do echo " ${STATUS}" fi git pull &> /dev/null -done >> ${LOGFILE} +done -echo "$(date +'%F_%R:%S') ------ END ------" >> ${LOGFILE} +echo "$(date +'%F_%R:%S') ------ END ------" From 798287641ab3cecc20642f2fbb8ace3c5ec19b7c Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 2 May 2022 12:59:32 +0100 Subject: [PATCH 5/6] New aliases --- root/.bash_aliases | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 root/.bash_aliases diff --git a/root/.bash_aliases b/root/.bash_aliases new file mode 100644 index 0000000..13e88b5 --- /dev/null +++ b/root/.bash_aliases @@ -0,0 +1,9 @@ +# New by Dave +# HEADER: =========================================================== +# HEADER: This file is automanaged by puppet +# HEADER: While it can still be managed manually, it is definitely not recommended. +# HEADER: Any manual changes to this file run the risk of being overwritten! +# HEADER: =========================================================== + +alias lspuppet='tail -fn20 /var/log/puppetlabs/puppet-apply.log' +alias lsrepo='tail -fn20 /var/log/repofix/repofix.log' \ No newline at end of file From c694fbd87df4cde80999ad7563f83d3599e6b4a6 Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 12 Jun 2022 11:18:38 +0100 Subject: [PATCH 6/6] Initial ppopulation --- etc/sabnzb.ini | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 etc/sabnzb.ini diff --git a/etc/sabnzb.ini b/etc/sabnzb.ini new file mode 100644 index 0000000..9e71772 --- /dev/null +++ b/etc/sabnzb.ini @@ -0,0 +1,2 @@ +## this is a config file for SAB +## seems the standard configs \ No newline at end of file