voidrice/.scripts/cron/checkup

19 lines
592 B
Text
Raw Normal View History

2018-11-26 19:17:18 +00:00
#!/bin/sh
# Syncs repositories and downloads updates, meant to be run as a cronjob.
2019-03-20 18:45:08 +00:00
ping -q -c 1 1.1.1.1 > /dev/null || exit
2018-11-26 19:17:18 +00:00
2019-03-20 18:45:08 +00:00
notify-send "📦 Checking for package updates..."
2018-11-26 19:17:18 +00:00
2019-01-04 01:39:10 +00:00
sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates.
2018-11-26 19:17:18 +00:00
Check your internet connection, if pacman is already running, or run update manually to see errors."
pkill -RTMIN+8 i3blocks
2019-01-05 04:08:49 +00:00
if pacman -Qu | grep -v "\[ignored\]"
2018-11-26 19:17:18 +00:00
then
2019-03-20 18:45:08 +00:00
notify-send "🎁 Package updates available. Click statusbar icon (📦) for update."
2018-11-26 19:17:18 +00:00
else
2019-03-20 18:45:08 +00:00
notify-send "📦 Repository sync complete. No new packages for update."
2018-11-26 19:17:18 +00:00
fi