mirror of
https://github.com/edu4rdshl/upcheck.git
synced 2026-07-17 23:24:49 +00:00
Initial commit.
This commit is contained in:
parent
4bb1d8f650
commit
0a045c6fee
3 changed files with 35 additions and 0 deletions
13
upcheck
Executable file
13
upcheck
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if ! command -v checkupdates > /dev/null || ! command -v notify-send > /dev/null ; then
|
||||
echo "Error: You need to install the pacman-contrib and libnotify packages."
|
||||
exit
|
||||
fi
|
||||
|
||||
available_updates="$(checkupdates)"
|
||||
|
||||
if [[ -n $available_updates ]]; then
|
||||
notify-send "The following updates are available:" --icon=dialog-information
|
||||
notify-send "$available_updates"
|
||||
fi
|
||||
12
upcheck.service
Normal file
12
upcheck.service
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description=Automatically check updates and send notifications via libnotify
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/home/sechacklabs/.local/bin/upcheck
|
||||
KillMode=process
|
||||
KillSignal=SIGINT
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
10
upcheck.timer
Normal file
10
upcheck.timer
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=Check for ArchLinux available updates every 1.5 hours.
|
||||
|
||||
[Timer]
|
||||
OnBootSec=10min
|
||||
OnUnitActiveSec=1h 30min
|
||||
Unit=upcheck.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue