项目作者: losuler

项目描述 :
Notify about new updates in dnf.
高级语言: Shell
项目地址: git://github.com/losuler/dnf-notify.git
创建时间: 2021-10-12T23:38:29Z
项目社区:https://github.com/losuler/dnf-notify

开源协议:GNU General Public License v3.0

下载





DNF Notify



Notify about new updates in dnf.




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:

  1. 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

  1. Usage: dnf-notify [OPTION]...
  2. Check for and notify of new updates available.
  3. -c PATH Path to the config file
  4. -h Print help and exit

Configuration

Enable the service you would like to recieve notifications on (e.g. Matrix):

  1. # Enable/Disable (Default: Disable)
  2. 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 ➝ SettingsAdvanced.

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:

  1. curl -XPOST -d '{"type":"m.login.password", "user":"$USERNAME", "password":"$PASSWORD"}' \
  2. "https://matrix.org/_matrix/client/r0/login"