From 99e8927afdcdf94dab3a84c7295bda4be5c3663e Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sun, 16 Apr 2023 23:06:06 +0700 Subject: [PATCH] add pullscripts (test mode) --- files/pullgit.service | 9 +++++++++ files/pullgit.sh | 6 ++++++ files/pullgit.timer | 10 ++++++++++ 3 files changed, 25 insertions(+) create mode 100644 files/pullgit.service create mode 100644 files/pullgit.sh create mode 100644 files/pullgit.timer diff --git a/files/pullgit.service b/files/pullgit.service new file mode 100644 index 0000000..9eec674 --- /dev/null +++ b/files/pullgit.service @@ -0,0 +1,9 @@ +[Unit] +Description=Pull git changes + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/pullgit.sh + +[Install] +WantedBy=multi-user.target diff --git a/files/pullgit.sh b/files/pullgit.sh new file mode 100644 index 0000000..40f8d2e --- /dev/null +++ b/files/pullgit.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +git config --global user.name vestasync_wb_$(hostname) +git config --global user.email "vestasync@fake.mail" +cd /mnt/data/etc/ +git fetch > /dev/null 2>&1 || true +git pull > /dev/null 2>&1 || true diff --git a/files/pullgit.timer b/files/pullgit.timer new file mode 100644 index 0000000..e6a4f29 --- /dev/null +++ b/files/pullgit.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Run pullgit.service every 10 min + +[Timer] +OnCalendar=*:0/10 +Persistent=true +Unit=pullgit.service + +[Install] +WantedBy=timers.target