Guest User

Untitled

a guest
Oct 29th, 2025
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. ###time in seconds after login until first check for updates:
  4. sleep 60
  5.  
  6.  
  7. ### start of the loop
  8.  
  9. while true
  10. do
  11.  
  12.  
  13.  
  14. ### 1. fetch metadata
  15. pkcon refresh force > /dev/null 2>&1
  16. sleep 3
  17.  
  18.  
  19. ### 2. check for available updates for stable and unstable repositories
  20.  
  21. UPDATESSTABLE=`pkcon get-updates --plain | grep -i -c "(Solus)"`
  22. UPDATESUNSTABLE=`pkcon get-updates --plain | grep -i -c "(Unstable)"`
  23.  
  24. if [[ "$UPDATESSTABLE" -eq 0 && "$UPDATESUNSTABLE" -eq 0 ]]; then
  25. # No Updates available !
  26. echo -e "\033[1;33msolus-pkcon-check-for-updates: No Updates are available !\033[0m"
  27.  
  28. else
  29. # Updates available !
  30. echo -e "\033[1;32msolus-pkcon-check-for-updates: Updates are available !\033[0m"
  31.  
  32. fi
  33.  
  34.  
  35. if [ "$UPDATESSTABLE" -gt 0 ]; then
  36.  
  37. # send notification
  38. notify-send \
  39. --app-name="EOPKG" \
  40. -i software-update-available \
  41. -u critical \
  42. "System-Updates available!" \
  43. "You can run sudo eopkg up to update your system.\n\n"
  44.  
  45. fi
  46.  
  47.  
  48.  
  49. if [ "$UPDATESUNSTABLE" -gt 0 ]; then
  50.  
  51.  
  52. # send notification
  53. notify-send \
  54. --app-name="EOPKG" \
  55. -i software-update-available \
  56. -u critical \
  57. "System-Updates available! (Unstable !!!)" \
  58. "Check packaging matrix channel before updating!\n\n"
  59.  
  60. fi
  61.  
  62.  
  63.  
  64. ###check for updates every x seconds: 3600 seconds equals 60 minutes. You can change this value.
  65. sleep 3600
  66. done
  67.  
  68. exit 0
Advertisement
Add Comment
Please, Sign In to add comment