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