summaryrefslogtreecommitdiffstats
path: root/.local/bin/cron/checkup
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2019-11-23 16:16:30 -0500
committerLuke Smith <luke@lukesmith.xyz>2019-11-23 16:16:30 -0500
commita5e66ac4f45322b3665c944ba34d83b7db43ebc5 (patch)
treebed315d0a7f2c180b3eb634ece3a6a2089cdeb6f /.local/bin/cron/checkup
parent85d353d7963391cd66f23a3e99a66b8b58045e4c (diff)
downloadeibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.tar.gz
eibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.tar.zst
eibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.zip
merger of bin
Diffstat (limited to '.local/bin/cron/checkup')
-rwxr-xr-x.local/bin/cron/checkup18
1 files changed, 18 insertions, 0 deletions
diff --git a/.local/bin/cron/checkup b/.local/bin/cron/checkup
new file mode 100755
index 0000000..927b9d8
--- /dev/null
+++ b/.local/bin/cron/checkup
@@ -0,0 +1,18 @@
+#!/usr/bin/env sh
+# Syncs repositories and downloads updates, meant to be run as a cronjob.
+
+ping -q -c 1 1.1.1.1 > /dev/null || exit
+
+notify-send "📦 Repository Sync" "Checking for package updates..."
+
+sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates.
+
+Check your internet connection, if pacman is already running, or run update manually to see errors."
+pkill -RTMIN+8 i3blocks
+
+if pacman -Qu | grep -v "\[ignored\]"
+then
+ notify-send "🎁 Repository Sync" "Updates available. Click statusbar icon (📦) for update."
+else
+ notify-send "📦 Repository Sync" "Sync complete. No new packages for update."
+fi