Skip to content

Commit

Permalink
repo-refresh: new
Browse files Browse the repository at this point in the history
  • Loading branch information
eatradish committed Sep 19, 2023
1 parent 8ac7bf1 commit 690c483
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions repo-refresh/repo-refresh.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Unit]
Description=Check for package update
ConditionACPower=true

[Service]
Type=oneshot
ExecStart=/usr/libexec/repo-refresh.sh
7 changes: 7 additions & 0 deletions repo-refresh/repo-refresh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if command -v oma > /dev/null; then
oma refresh --no-progress
else
apt update
fi
11 changes: 11 additions & 0 deletions repo-refresh/repo-refresh.timer
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 690c483

Please sign in to comment.