Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- ###time in seconds after login until first check for updates:
- sleep 60
- ### start of the loop
- while true
- do
- ### 1. fetch metadata
- pkcon refresh force > /dev/null 2>&1
- sleep 3
- ### 2. check for available updates for stable and unstable repositories
- UPDATESSTABLE=`pkcon get-updates --plain | grep -i -c "(Solus)"`
- UPDATESUNSTABLE=`pkcon get-updates --plain | grep -i -c "(Unstable)"`
- if [[ "$UPDATESSTABLE" -eq 0 && "$UPDATESUNSTABLE" -eq 0 ]]; then
- # No Updates available !
- echo -e "\033[1;33msolus-pkcon-check-for-updates: No Updates are available !\033[0m"
- else
- # Updates available !
- echo -e "\033[1;32msolus-pkcon-check-for-updates: Updates are available !\033[0m"
- fi
- if [ "$UPDATESSTABLE" -gt 0 ]; then
- # send notification
- notify-send \
- --app-name="EOPKG" \
- -i software-update-available \
- -u critical \
- "System-Updates available!" \
- "You can run sudo eopkg up to update your system.\n\n"
- fi
- if [ "$UPDATESUNSTABLE" -gt 0 ]; then
- # send notification
- notify-send \
- --app-name="EOPKG" \
- -i software-update-available \
- -u critical \
- "System-Updates available! (Unstable !!!)" \
- "Check packaging matrix channel before updating!\n\n"
- fi
- ###check for updates every x seconds: 3600 seconds equals 60 minutes. You can change this value.
- sleep 3600
- done
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment