diff --git a/repo-refresh/repo-refresh.service b/repo-refresh/repo-refresh.service new file mode 100644 index 0000000..07e8c1d --- /dev/null +++ b/repo-refresh/repo-refresh.service @@ -0,0 +1,7 @@ +[Unit] +Description=Check for package update +ConditionACPower=true + +[Service] +Type=oneshot +ExecStart=/usr/libexec/repo-refresh.sh diff --git a/repo-refresh/repo-refresh.sh b/repo-refresh/repo-refresh.sh new file mode 100755 index 0000000..9efbb43 --- /dev/null +++ b/repo-refresh/repo-refresh.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if command -v oma > /dev/null; then + oma refresh --no-progress +else + apt update +fi diff --git a/repo-refresh/repo-refresh.timer b/repo-refresh/repo-refresh.timer new file mode 100644 index 0000000..fe9ae30 --- /dev/null +++ b/repo-refresh/repo-refresh.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Check for package updates + +[Timer] +OnCalendar=*-*-* 6,18:00 +RandomizedDelaySec=12h +AccuracySec=1h +Persistent=true + +[Install] +WantedBy=timers.target \ No newline at end of file