Skip to content

Instantly share code, notes, and snippets.

@douo
Created January 2, 2024 13:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douo/67e5e8c9508eca14f34b0357c90fed74 to your computer and use it in GitHub Desktop.
Save douo/67e5e8c9508eca14f34b0357c90fed74 to your computer and use it in GitHub Desktop.
Journald Telegram Notifier
[Unit]
Description=Journald Telegram Notifier
After=network.target
[Service]
Type=simple
ExecStart=/bin/sh -c 'journalctl -b -f -p "2..3" -t kernel | awk -F ": " "{ st = index(\$0,\\\": \\\"); system(\\\"apprise tgram://bottoken/ChatID -vv -t \\\\\\\"\\\" \$1 \\\"\\\\\\\" -b \\\\\\\"\\\" substr(\$0,st+2) \\\"\\\\\\\"\\\")}"'
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment