mirror of
https://github.com/SinTan1729/random.git
synced 2024-12-26 13:18:35 -06:00
new : Added qbt-send-msg.sh
This commit is contained in:
parent
3022a5b273
commit
be806fc459
2 changed files with 15 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
![Number of scripts](https://img.shields.io/badge/number_of_scripts-34-blue)
|
![Number of scripts](https://img.shields.io/badge/number_of_scripts-35-blue)
|
||||||
# Random Scripts
|
# Random Scripts
|
||||||
This repository is for random scripts I wrote mostly for personal use.
|
This repository is for random scripts I wrote mostly for personal use.
|
||||||
|
|
||||||
|
|
14
qbt-send-msg.sh
Normal file
14
qbt-send-msg.sh
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# A very simple script to send message using telegram.sh whenever a torrent is added/completed
|
||||||
|
# in qBittorrent. Just call the script from qBittorrent's external script option
|
||||||
|
# using <script> "%N" "%Z" (add/fin)
|
||||||
|
|
||||||
|
name="$1"
|
||||||
|
size="$(echo $2 | numfmt --to=iec --format %.2f)B"
|
||||||
|
|
||||||
|
if [ "$3" == "add" ]; then
|
||||||
|
/downloads/.telegram/telegram.sh -T "qBittorrent" -M "The torrent '$name' ($size) has been added."
|
||||||
|
elif [ "$3" == "fin" ]; then
|
||||||
|
/downloads/.telegram/telegram.sh -T "qBittorrent" -M "The torrent '$name' ($size) has finished downloading."
|
||||||
|
fi
|
Loading…
Reference in a new issue