systemd service that sends an email or telegram message if your system has pending updates.
Sends a notification if:
- last notification was send before last update
- there are new updates after last notification was send
- small bash-script (may be used as a cronjob)
- systemd-unit with timer
- cron-mail mode (less output)
- aur support with
package-query
- send update-list via mail.
- send update-list via telegram bots.
Usage: pun [OPTIONS]
-h ; --help Show this help message"
-c ; --config CONFIG Use config file CONFIG"
-p Force to use pacman"
-d Dry run: Send no mail, telegram, etc."
-v Force output of updates list"
--cron Only print if a mail would be send (cron mail compatible)"
-q ; --quiet Quiet mode, only errors are printed"
-m ; --mail ADDRESS Send update-list via mail to ADDRESS"
-t ; --telegram ID Send update-list via telegram to contact ID"
--telegram-token TOKEN API-Token for the telegram telegram bot"
If package-query is installed, it will be used by default.
Force use of pacman with the -p switch (no aur).
- Copy
pun
into your$PATH
, typically/usr/local/bin
To run pun automatically once every hour use the systemd-timer
$ sudo systemctl start pun.timer
$ sudo systemctl enable pun.timer
If used as a cron job start with the --cron
option or set OUTPUT=cron
in the config file.
In this mode you may send the output via cron mail.
To send telegram messages pun uses an official Telegram Bot. For this Bot to work
you need to provide your telegram user id.
You may get your telegram user id with the provided pun-search-telegram-id
script,
after you've sent a message to the NotifyBot.
The default config is in /etc/pun.conf
. Commandline arguments overwrite this options.
FORCE_PACMAN=0 # force usage of pacman -> no aur support
OUTPUT=log # output mode
USE_MAIL=0 # send notification mail
MAIL_ADDRESS= # destination mail address
USE_TELEGRAM=0 # send notification message with telegram-cli
TELEGRAM_CONTACT= # destination telegram contact id
TELEGRAM_TOKEN= # token for the PUN telegram bot
Output-modes:
- none: don't generate any output (no logs, no mail).
- cron: quiet mode for cron mail. Only generates error messages or output if a mail would have been send.
- verbose: always show package-list, etc.
Don't change the TELEGRAM_TOKEN, unless you know, what you're doing!
Error: cannot update database
- pacman needs root-rights. try with sudo
- check internet-connection
Error: cannot find pacman. Your system is weird!
- is pacman in your
$PATH
and executable? - wrong distro?
- is pacman in your
Error: cannot fetch update list
- check internet-connection
- cron example
- test mail and telegram integration
(c) 2015 Bernd Busse, Daniel Jankowski
Licensed under the GNU Lesser General Public License 3 (LGPLv3). See LICENSE for details.