qbittorrent: add start notification script

This commit is contained in:
Tigor Hutasuhut 2024-09-07 20:12:52 +07:00
parent cb6479e4a4
commit 7f58e16a39

View file

@ -62,7 +62,16 @@ in
-H "X-Title: $1" \ -H "X-Title: $1" \
-H "X-Tags: white_check_mark,$2" \ -H "X-Tags: white_check_mark,$2" \
-d "Number of Files: $7, Size: $8" \ -d "Number of Files: $7, Size: $8" \
https://ntfy.tigor.web.id/qbittorrent-finish https://ntfy.tigor.web.id/qbittorrent
'');
start-notify-script = pkgs.writeScriptBin "notify-start.sh" (optionalString config.services.ntfy-sh.enable /*sh*/ ''
#!/bin/bash
curl -X POST \
-H "Authorization: Bearer $NTFY_TOKEN" \
-H "X-Title: $1" \
-H "X-Tags: rocket,$2" \
-d "Number of Files: $7, Size: $8" \
https://ntfy.tigor.web.id/qbittorrent
''); '');
in in
{ {
@ -82,6 +91,7 @@ in
"${volume}/progress:/progress" "${volume}/progress:/progress"
"${volume}/watch:/watch" "${volume}/watch:/watch"
"${finish-notify-script}/bin/notify-finish.sh:/bin/notify-finish" "${finish-notify-script}/bin/notify-finish.sh:/bin/notify-finish"
"${start-notify-script}/bin/notify-start.sh:/bin/notify-start"
]; ];
ports = [ ports = [
"6881:6881" "6881:6881"