https://github.com/losuler/dnf-notify
Notify about new updates in dnf.
https://github.com/losuler/dnf-notify
automatic centos dnf fedora notifications rpm systemd updates
Last synced: 4 months ago
JSON representation
Notify about new updates in dnf.
- Host: GitHub
- URL: https://github.com/losuler/dnf-notify
- Owner: losuler
- License: gpl-3.0
- Created: 2021-10-12T23:38:29.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-22T12:39:09.000Z (over 3 years ago)
- Last Synced: 2025-02-08T22:07:07.257Z (4 months ago)
- Topics: automatic, centos, dnf, fedora, notifications, rpm, systemd, updates
- Language: Shell
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
DNF Notify
Notify about new updates indnf
.
## About
A simple bash script to overcome the limitations in notifications in `dnf-automatic`. In the past I had used a hack on the `[command_email]` section in `automatic.conf` to send notifications via Telegram with the following:
```sh
command_format = "curl --silent --output /dev/null --data-urlencode 'chat_id={{ chat_id }}' --data @- 'https://api.telegram.org/bot{{ bot_token }}/sendMessage'"
```However due to the desire to use Matrix and have a different output than just what updates had been automatically installed, along with the added complexity that would come with escaping this for `json`, I wrote this simple script to do this for me.
## Usage
```
Usage: dnf-notify [OPTION]...
Check for and notify of new updates available.
-c PATH Path to the config file
-h Print help and exit
```## Configuration
Enable the service you would like to recieve notifications on (e.g. Matrix):
```sh
# Enable/Disable (Default: Disable)
MATRIX="enable"
```### Matrix
`MATRIX_DOMAIN`
This is the domain for the Matrix server your room is hosted on. For most people this will likely be `matrix.org`.
`MATRIX_ROOM`
This is the internal room ID. The syntax is `!` followed by a random set of letters, for example `!abCDEfGhiJKLMnopQRs`. In Element you can find this by going to the room ➝ `Settings` ➝ `Advanced`.
`MATRIX_TOKEN`
This is the access token or secret that is used to authenticate the sending of the messages. You may retrieve this by either logging into Element through the browser or running the following command and copying the value from `access_token`:
```sh
curl -XPOST -d '{"type":"m.login.password", "user":"$USERNAME", "password":"$PASSWORD"}' \
"https://matrix.org/_matrix/client/r0/login"
```