Skip to content

Instantly share code, notes, and snippets.

@te-online
Created April 23, 2016 21:35
Show Gist options
  • Save te-online/2931a4ab201d34505c18435c2167262d to your computer and use it in GitHub Desktop.
Save te-online/2931a4ab201d34505c18435c2167262d to your computer and use it in GitHub Desktop.
A shell file that uses telegram-notify.sh to send a Telegram message via a bot when you check it.
#!/bin/bash
CURRENT_ROOT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g')
CURRENT_BACKUP=$(df /dev/sda | grep / | awk '{ print $5}' | sed 's/%//g')
MESSAGE="Just had a look at the space of my disks 🔬.
My *root disk's* remaining free space is *${CURRENT_ROOT}%*.
My *backup disk's* remaining free space is *${CURRENT_BACKUP}%*."
sh telegram-notify.sh "${MESSAGE}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment