Skip to content

Instantly share code, notes, and snippets.

@drushadrusha
Created January 27, 2023 06:28
Show Gist options
  • Save drushadrusha/1bddbb8dc60c76d04532dd26dc9aca6e to your computer and use it in GitHub Desktop.
Save drushadrusha/1bddbb8dc60c76d04532dd26dc9aca6e to your computer and use it in GitHub Desktop.
systemd service notifications in telegram without fucking python scripts and other trash
ExecStartPost=/bin/bash -c "SERVICE_NAME=%n;curl \"https://api.telegram.org/botTOKEN/sendMessage?chat_id=20515652&text=✅ Service $SERVICE_NAME started on $HOSTNAME\""
ExecStopPost=/bin/bash -c "SERVICE_NAME=%n;curl \"https://api.telegram.org/botTOKEN/sendMessage?chat_id=20515652&text=❌ Service $SERVICE_NAME stopped on $HOSTNAME\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment